Initial commit: monorepo Match Live TV.
Rails API, app Flutter, infrastruttura Docker/MediaMTX, sito marketing e documentazione di deploy. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
22
backend/app/jobs/disconnection_timeout_job.rb
Normal file
22
backend/app/jobs/disconnection_timeout_job.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
class DisconnectionTimeoutJob
|
||||
include Sidekiq::Job
|
||||
|
||||
def perform(session_id)
|
||||
session = StreamSession.find_by(id: session_id)
|
||||
return unless session&.reconnecting?
|
||||
|
||||
session.finish! if session.may_finish?
|
||||
session.update!(timeout_job_id: nil)
|
||||
session.stream_events.create!(
|
||||
event_type: "error",
|
||||
metadata: { reason: "reconnect_timeout" },
|
||||
occurred_at: Time.current
|
||||
)
|
||||
SessionChannel.broadcast_message(session, {
|
||||
type: "stream_event",
|
||||
event: "timeout_ended",
|
||||
message: "Session ended after reconnect timeout"
|
||||
})
|
||||
Sessions::Stop.new(session).call
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user