summaryrefslogtreecommitdiff
path: root/recording/runner.go
diff options
context:
space:
mode:
authorKeuin <[email protected]>2022-09-07 10:46:33 +0800
committerKeuin <[email protected]>2022-09-07 10:46:33 +0800
commitc78edaa0ffa28bb360663f172e98540b7978e9b2 (patch)
tree6e99ca4c42d31eb8516fe8b16a445f3618530948 /recording/runner.go
parentfd48122ae9c340b867bb31dbbde6a3b7a4667944 (diff)
Handle error correctly when copying live stream.
Diffstat (limited to 'recording/runner.go')
-rw-r--r--recording/runner.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/recording/runner.go b/recording/runner.go
index cee4325..a4693fb 100644
--- a/recording/runner.go
+++ b/recording/runner.go
@@ -85,7 +85,7 @@ func doTask(ctx context.Context, task *TaskConfig) error {
for !cancelled {
cancelled = record(recorderCtx, bi, task)
}
- logger.Printf("Task is cancelled. (room %v)\n", task.RoomId)
+ logger.Printf("Task is cancelled. Stop recording. (room %v)\n", task.RoomId)
}()
lastStatusIsLiving = true
case WatcherLiveStop:
@@ -159,7 +159,11 @@ func record(
logger.Printf("Recording live stream to file \"%v\"...", filePath)
err = bi.CopyLiveStream(ctx, task.RoomId, streamSource, file)
- cancelled = false
+ cancelled = err == nil
+ if !cancelled {
+ // real error happens
+ logger.Printf("Error when copying live stream: %v\n", err)
+ }
return
}