fedibird-fe/app/workers/expired_status_worker.rb

17 lines
418 B
Ruby
Raw Normal View History

2021-07-16 06:38:50 +00:00
# frozen_string_literal: true
class ExpiredStatusWorker
include Sidekiq::Worker
sidekiq_options retry: 0, dead: false
def perform(status_id)
status = Status.find(status_id)
status_expire = status.status_expire
RemoveStatusService.new.call(status, redraft: false, mark_expired: status_expire.present? && status_expire.expires_mark?)
rescue ActiveRecord::RecordNotFound
true
end
end