chat_session_leave_temporary.rb 398 B

12345678910111213141516171819
  1. class Sessions::Event::ChatSessionLeaveTemporary < Sessions::Event::ChatBase
  2. def run
  3. return super if super
  4. return if !check_chat_session_exists
  5. chat_session = current_chat_session
  6. Delayed::Job.enqueue(
  7. Observer::Chat::Leave::BackgroundJob.new(chat_session.id, @client_id, @session),
  8. {
  9. run_at: Time.zone.now + 0.5.minutes
  10. }
  11. )
  12. false
  13. end
  14. end