97192d9a77
The reason for unattaching media instead of removing it is to support delete & redraft functionality, but remote or staff-removed statuses will never be redrafted, so the media should be deleted immediately
11 lines
257 B
Ruby
11 lines
257 B
Ruby
# frozen_string_literal: true
|
|
|
|
class RemovalWorker
|
|
include Sidekiq::Worker
|
|
|
|
def perform(status_id, options = {})
|
|
RemoveStatusService.new.call(Status.find(status_id), **options.symbolize_keys)
|
|
rescue ActiveRecord::RecordNotFound
|
|
true
|
|
end
|
|
end
|