gab-social/app/workers/scheduler/expiring_chat_messages_scheduler.rb
mgabdev 7ec426e3d8 Progress on DMs
Progress on DMs
2020-12-19 01:33:33 -05:00

17 lines
332 B
Ruby

# frozen_string_literal: true
class Scheduler::ExpiringChatMessagesScheduler
include Sidekiq::Worker
def perform
expired_chat_messages.find_each do |chat_message|
DeleteChatMessageWorker.perform_async(chat_message.id)
end
end
private
def expired_chat_messages
ChatMessage.unscoped.expired
end
end