首页 > 解决方案 > 缓存文件的 Errno::ENOENT

问题描述

我有下一个缓存代码:

Rails.cache.fetch('ham_response_fids', expires_in: 1.minutes, race_condition_ttl: 10.seconds) do
  # code omitted
end

有时我会收到下一个错误:

Errno::ENOENT: No such file or directory @ rb_sysopen - /home/deployer/apps/fids/releases/20190604090924/tmp/cache/70A/380/.permissions_check.70228682401260.18260.410918

我不知道为什么会这样。它不是每次都发生,而是经常发生。

标签: ruby-on-railscaching

解决方案


我没有找到这个问题的根源。但是我通过将缓存存储从文件更改为 Memcache 来解决它。


推荐阅读