summaryrefslogtreecommitdiff
path: root/workers.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2023-02-17 12:14:21 +0600
committerGrail Finder <wohilas@gmail.com>2023-02-17 12:14:21 +0600
commitdf498c756b1cb0e3f045bc88396223272b713a4c (patch)
tree9f7725adfdd87c592aac10a03e516f0f88087404 /workers.go
parent520aae362ecdac0b60c9aca19b83cac1061813de (diff)
Feat: add time check and test
Diffstat (limited to 'workers.go')
-rw-r--r--workers.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/workers.go b/workers.go
index bbd5223..6fa4835 100644
--- a/workers.go
+++ b/workers.go
@@ -2,14 +2,15 @@ package main
import "fmt"
-func worker(queue chan *Utterance, worknumber int, done chan bool) {
+func worker(queue chan *Utterance, worknumber int, geshaft chan *Utterance) {
for {
- select {
- case ut := <-queue:
- cutoutClipAndTranscode(ut)
- case <-done:
- fmt.Println("worker stoped, number", worknumber)
+ if len(queue) == 0 {
+ fmt.Println("empty queue, number", worknumber)
return
}
+ ut := <-queue
+ if err := cutoutClipAndTranscode(ut); err == nil {
+ geshaft <- ut
+ }
}
}