fix: high cpu usage fix

This commit is contained in:
Khairul Hidayat 2024-08-25 08:36:28 +07:00
parent 4532b7a87a
commit dced610d6b

View File

@ -1,6 +1,10 @@
package lib package lib
import "rul.sh/go-ytmp3/utils" import (
"time"
"rul.sh/go-ytmp3/utils"
)
type Task struct { type Task struct {
Url string `json:"url"` Url string `json:"url"`
@ -48,6 +52,7 @@ func InitTaskScheduler() *TaskScheduler {
return return
default: default:
if len(queue) == 0 { if len(queue) == 0 {
time.Sleep(1 * time.Second)
continue continue
} }