From 2f0ef363eabce940314dc33f5966335642722fa2 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 29 Jul 2023 21:23:33 +0800 Subject: Distinguish waiting and recording status --- recording/task.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'recording/task.go') diff --git a/recording/task.go b/recording/task.go index 43b6678..d1f9c79 100644 --- a/recording/task.go +++ b/recording/task.go @@ -18,14 +18,16 @@ type TaskStatus int const ( StNotStarted TaskStatus = iota - StRunning + StWaiting + StRecording StRestarting StStopped ) var taskStatusStrings = map[TaskStatus]string{ StNotStarted: "ready", - StRunning: "running", + StWaiting: "waiting", + StRecording: "recording", StRestarting: "restarting", StStopped: "stopped", } @@ -94,7 +96,7 @@ func (t *RunningTask) StartTask() error { t.runTaskWithAutoRestart() }() return nil - case StRunning: + case StWaiting, StRecording: return ErrTaskIsAlreadyStarted case StRestarting: return ErrTaskIsAlreadyStarted -- cgit v1.2.3