about summary refs log tree commit diff
path: root/app/workers/cache_buster_worker.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/cache_buster_worker.rb')
-rw-r--r--app/workers/cache_buster_worker.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/workers/cache_buster_worker.rb b/app/workers/cache_buster_worker.rb
new file mode 100644
index 000000000..5ad0a44cb
--- /dev/null
+++ b/app/workers/cache_buster_worker.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class CacheBusterWorker
+  include Sidekiq::Worker
+  include RoutingHelper
+
+  sidekiq_options queue: 'pull'
+
+  def perform(path)
+    cache_buster.bust(full_asset_url(path))
+  end
+
+  private
+
+  def cache_buster
+    CacheBuster.new(Rails.configuration.x.cache_buster)
+  end
+end