about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-11-18 04:39:27 -0600
committermultiple creatures <dev@multiple-creature.party>2019-11-18 04:39:27 -0600
commit345c6beb7e8a26e3537506ab3134c509d4ef6dc8 (patch)
treef7c26aa34d2324bc3e89ebffa27b48336be6ede0 /app
parent2c32b36a57c7e00c34b06d3c223b291e06c651cc (diff)
Auto-remove expired filters.
Diffstat (limited to 'app')
-rw-r--r--app/workers/scheduler/filter_cleanup_scheduler.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/workers/scheduler/filter_cleanup_scheduler.rb b/app/workers/scheduler/filter_cleanup_scheduler.rb
new file mode 100644
index 000000000..8e1e4db81
--- /dev/null
+++ b/app/workers/scheduler/filter_cleanup_scheduler.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class Scheduler::FilterCleanupScheduler
+  include Sidekiq::Worker
+
+  sidekiq_options unique: :until_executed
+
+  def perform
+    CustomFilter.expired.in_batches.destroy_all
+  end
+end