gab-social/app/workers/scheduler/expiring_chat_messages_scheduler.rb

17 lines
332 B
Ruby
Raw Normal View History

2020-12-19 06:33:33 +00:00
# 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