Skip to content

Commit

Permalink
Add EndedAt field to Ingress State (#40)
Browse files Browse the repository at this point in the history
Set ended_at on ingress end
  • Loading branch information
biglittlebigben authored Jan 9, 2024
1 parent da9ac82 commit 4440158
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/params/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,15 @@ func (p *Params) SetStatus(status livekit.IngressState_Status, errString string)

p.State.Status = status
p.State.Error = errString

switch status {
case livekit.IngressState_ENDPOINT_COMPLETE,
livekit.IngressState_ENDPOINT_INACTIVE,
livekit.IngressState_ENDPOINT_ERROR:
if p.State.EndedAt == 0 {
p.State.EndedAt = time.Now().UnixNano()
}
}
}

func (p *Params) SetRoomId(roomId string) {
Expand Down

0 comments on commit 4440158

Please sign in to comment.