diaspora/app/workers/cleanup_pending_photos.rb
Benjamin Neff df4e79b842
Cleanup pending photos which were never posted with cronjob
Only delete photos older than a day, so we don't delete photos for posts
which were uploaded 10 minutes ago and the author is still writing the
post for it.

closes #8041
2019-07-03 13:24:27 +02:00

11 lines
229 B
Ruby

# 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