-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
After cached items are promoted and file derivatives are produced, we have no need of them anymore. This rake task will run nightly to remove items a week old from our cache. Fixes geobtaa/geoblacklight_admin#63
- Loading branch information
Showing
2 changed files
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace :geoportal do | ||
namespace :s3 do | ||
desc 'Clear S3 Cache' | ||
task clear_cache: :environment do | ||
Shrine.storages[:cache].clear! { |object| object.last_modified < Time.now - 7*24*60*60 } | ||
end | ||
end | ||
end |