Skip to content

Commit

Permalink
fix: 修复循环依赖问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kercylan98 committed Mar 12, 2024
1 parent 43920c8 commit 6d8258b
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions utils/super/wg.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package super

import (
"github.com/kercylan98/minotaur/utils/log"
"sync"
)

Expand All @@ -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)
}

0 comments on commit 6d8258b

Please sign in to comment.