ruby-on-rails - 缓存文件的 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
我不知道为什么会这样。它不是每次都发生,而是经常发生。
解决方案
我没有找到这个问题的根源。但是我通过将缓存存储从文件更改为 Memcache 来解决它。
推荐阅读
- css - 使用 CSS 构建时间线
- python - 动态获取标准库 python 包名称列表
- webpack - webpack dev server 监视多个静态文件
- javascript - 在以下代码中在 JavaScript 中实现工厂模式的正确方法
- rust - 为给定的主机操作系统设置默认目标
- ios - SwiftUI:如何计算文本视图的宽度?
- sql - 从excel插入Oracle表
- php - 如何仅显示类别和标签的所有 WP 分类法?
- function - 传入的 int 在具有 int 参数的函数中未定义(Golang)
- javascript - 如何在 React Native 中渲染组件之前对从 firebase 接收的数据数组进行动态排序