about summary refs log tree commit diff
path: root/app/workers/scheduler
diff options
context:
space:
mode:
authormayaeh <mayaeh@marimo-net.org>2019-07-28 20:48:19 +0900
committerEugen Rochko <eugen@zeonfederated.com>2019-07-28 13:48:19 +0200
commit0d80f686d81e4a12db1ac54b8f31f69f375dc8dc (patch)
treed344fd47904a41943a69273c095c25fcbf79e6f3 /app/workers/scheduler
parent9349f1067a99c45648dc66f397b338d458d1a763 (diff)
Add `tootctl preview_cards remove` (#11320)
* Add `tootctl preview_cards remove`

* fix code style

* Remove `Scheduler::PreviewCardsCleanupScheduler` file

* fix code style again
Add exclude case where image_file_name is blank

* Added a function to output confirmation if the specified number of days is less than 2 weeks
Diffstat (limited to 'app/workers/scheduler')
-rw-r--r--app/workers/scheduler/preview_cards_cleanup_scheduler.rb22
1 files changed, 0 insertions, 22 deletions
diff --git a/app/workers/scheduler/preview_cards_cleanup_scheduler.rb b/app/workers/scheduler/preview_cards_cleanup_scheduler.rb
deleted file mode 100644
index 2b38792f0..000000000
--- a/app/workers/scheduler/preview_cards_cleanup_scheduler.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class Scheduler::PreviewCardsCleanupScheduler
-  include Sidekiq::Worker
-
-  sidekiq_options unique: :until_executed, retry: 0
-
-  def perform
-    Maintenance::UncachePreviewWorker.push_bulk(recent_link_preview_cards.pluck(:id))
-    Maintenance::UncachePreviewWorker.push_bulk(older_preview_cards.pluck(:id))
-  end
-
-  private
-
-  def recent_link_preview_cards
-    PreviewCard.where(type: :link).where('updated_at < ?', 1.month.ago)
-  end
-
-  def older_preview_cards
-    PreviewCard.where('updated_at < ?', 6.months.ago)
-  end
-end