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
11 lines
229 B
Ruby
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
|