Skip to content

Commit

Permalink
Delay stopping recording for 10 seconds.
Browse files Browse the repository at this point in the history
  • Loading branch information
patfair committed Jul 20, 2024
1 parent 646caff commit ee859fd
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions field/arena.go
Original file line number Diff line number Diff line change
Expand Up @@ -1132,18 +1132,21 @@ func (arena *Arena) startRecording() {

// Stops recording using configured, on-network Blackmagic Device
func (arena *Arena) stopRecording() {
var connections []net.Conn

for i := 0; i < len(arena.EventSettings.RecorderAddresses); i++ {
recCon, err := connectToRecorder(arena.EventSettings.RecorderAddresses[i])
if recCon == nil {
log.Println("recorder connection error: ", err)
} else {
connections = append(connections, recCon)
go func() {
time.Sleep(10 * time.Second)
var connections []net.Conn

for i := 0; i < len(arena.EventSettings.RecorderAddresses); i++ {
recCon, err := connectToRecorder(arena.EventSettings.RecorderAddresses[i])
if recCon == nil {
log.Println("recorder connection error: ", err)
} else {
connections = append(connections, recCon)
}
}
}

for i := 0; i < len(connections); i++ {
fmt.Fprint(connections[i], "stop\n")
}
for i := 0; i < len(connections); i++ {
fmt.Fprint(connections[i], "stop\n")
}
}()
}

0 comments on commit ee859fd

Please sign in to comment.