FIX: cache_file storage cleanup logic was wrong
https://meta.discourse.org/t/68296
This commit is contained in:
parent
2a22b90538
commit
5f4f617689
|
@ -131,7 +131,7 @@ module FileStore
|
||||||
FileUtils.mkdir_p(dir) unless Dir[dir].present?
|
FileUtils.mkdir_p(dir) unless Dir[dir].present?
|
||||||
FileUtils.cp(file.path, path)
|
FileUtils.cp(file.path, path)
|
||||||
# keep latest 500 files
|
# keep latest 500 files
|
||||||
`ls -tr #{CACHE_DIR} | head -n +#{CACHE_MAXIMUM_SIZE} | xargs rm -f`
|
`ls -tr #{CACHE_DIR} | head -n -#{CACHE_MAXIMUM_SIZE} | xargs rm -f`
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
Loading…
Reference in New Issue