16 lines
376 B
Ruby
16 lines
376 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Scheduler::InboxCleanupScheduler
|
|
include Sidekiq::Worker
|
|
|
|
sidekiq_options retry: false
|
|
|
|
def perform
|
|
orphaned_entries = Inbox.where(question_id: nil).includes(:user)
|
|
orphaned_entries.each do |inbox|
|
|
logger.info "Deleting orphaned inbox entry #{inbox.id} from user #{inbox.user.id}"
|
|
inbox.destroy
|
|
end
|
|
end
|
|
end
|