From 345c6beb7e8a26e3537506ab3134c509d4ef6dc8 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Mon, 18 Nov 2019 04:39:27 -0600 Subject: Auto-remove expired filters. --- app/workers/scheduler/filter_cleanup_scheduler.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 app/workers/scheduler/filter_cleanup_scheduler.rb (limited to 'app/workers') 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 -- cgit