fix: high cpu usage fix
This commit is contained in:
parent
4532b7a87a
commit
dced610d6b
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user