diff options
Diffstat (limited to 'app/workers/cleanup_pending_photos.rb')
-rw-r--r-- | app/workers/cleanup_pending_photos.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/workers/cleanup_pending_photos.rb b/app/workers/cleanup_pending_photos.rb new file mode 100644 index 000000000..e7cabf54b --- /dev/null +++ b/app/workers/cleanup_pending_photos.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Workers + class CleanupPendingPhotos < Base + sidekiq_options queue: :low + + def perform + Photo.where(pending: true).where("created_at < ?", 1.day.ago).destroy_all + end + end +end |