Update worker.go

This commit is contained in:
poiuty 2023-05-29 15:50:17 +03:00
parent 44177a0927
commit a5646a39f6

View file

@ -247,12 +247,12 @@ func xWorker(workerData Info, u url.URL) {
//fmt.Println(inmsg.User.Username, inmsg.User.Gender, inmsg.User.IsBroadcaster, inmsg.Action, workerData.room)
if inmsg.User.Username == workerData.room && inmsg.User.IsBroadcaster {
if inmsg.Action == "leave" {
if inmsg.Action == "leave" && !isLeave {
fmt.Println("leave, start ticker", workerData.room)
leave.Reset(60 * 10 * time.Second)
isLeave = true
}
if inmsg.Action == "enter" {
if inmsg.Action == "enter" && isLeave {
fmt.Println("enter, stop ticker", workerData.room)
leave.Reset(60 * 60 * 8 * time.Second)
isLeave = false