Bust caches at different intervals on restart (#11369)

This commit is contained in:
Ben Halpern 2020-11-11 11:27:53 -05:00 committed by GitHub
parent a56f3630bf
commit a7ac6a2c3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,9 +2,12 @@ namespace :cache do
desc "Enqueue BustCachePathWorker"
task enqueue_path_bust_workers: :environment do
# Trigger cache purges for globally-cached endpoints that could have changed
BustCachePathWorker.set(queue: :high_priority).perform_in(10.minutes, "/shell_top")
BustCachePathWorker.set(queue: :high_priority).perform_in(10.minutes, "/shell_bottom")
BustCachePathWorker.set(queue: :high_priority).perform_in(10.minutes, "/onboarding")
BustCachePathWorker.set(queue: :high_priority).perform_in(10.minutes, "/async_info/shell_version")
[30, 180, 600].each do |n|
BustCachePathWorker.set(queue: :high_priority).perform_in(n.seconds, "/")
BustCachePathWorker.set(queue: :high_priority).perform_in(n.seconds, "/shell_top")
BustCachePathWorker.set(queue: :high_priority).perform_in(n.seconds, "/shell_bottom")
BustCachePathWorker.set(queue: :high_priority).perform_in(n.seconds, "/onboarding")
BustCachePathWorker.set(queue: :high_priority).perform_in(n.seconds, "/async_info/shell_version")
end
end
end