fix: 修复循环依赖问题

This commit is contained in:
kercylan98 2024-03-12 20:17:44 +08:00
parent 43920c8ce0
commit 6d8258b153
1 changed files with 1 additions and 8 deletions

View File

@ -1,7 +1,6 @@
package super
import (
"github.com/kercylan98/minotaur/utils/log"
"sync"
)
@ -12,13 +11,7 @@ type WaitGroup struct {
func (w *WaitGroup) Exec(f func()) {
w.WaitGroup.Add(1)
go func(w *WaitGroup) {
defer func() {
w.WaitGroup.Done()
if err := RecoverTransform(recover()); err != nil {
log.Error("WaitGroup", log.Err(err))
}
}()
defer w.WaitGroup.Done()
f()
}(w)
}