fix: 解决闭包传值

pull/106/head
zhengkunwang223 2023-01-31 14:40:03 +08:00 committed by zhengkunwang223
parent d9a0ea1fe7
commit c6eb0fafe0
1 changed files with 4 additions and 3 deletions

View File

@ -2,6 +2,7 @@ package job
import (
"github.com/1Panel-dev/1Panel/backend/app/dto/request"
"github.com/1Panel-dev/1Panel/backend/app/model"
"github.com/1Panel-dev/1Panel/backend/app/repo"
"github.com/1Panel-dev/1Panel/backend/app/service"
"github.com/1Panel-dev/1Panel/backend/constant"
@ -29,9 +30,9 @@ func (w *website) Run() {
}
if site.ExpireDate.Before(now) {
wg.Add(1)
go func() {
stopWebsite(site.ID, &wg)
}()
go func(ws model.Website) {
stopWebsite(ws.ID, &wg)
}(site)
}
}
wg.Wait()