fix: init failed bar not close and total bar not wait

This commit is contained in:
M09Ic 2025-02-22 14:01:10 +08:00
parent 5f8f5c7795
commit 286710f5ec
2 changed files with 3 additions and 1 deletions

View File

@ -694,8 +694,8 @@ func (pool *BrutePool) doCheck() {
}
pool.isFallback.Store(true)
pool.fallback()
pool.Cancel()
pool.IsFailed = true
pool.Cancel()
return
}

View File

@ -204,6 +204,7 @@ func (r *Runner) Prepare(ctx context.Context) error {
brutePool.Statistor.Error = err.Error()
if !r.Force {
// 如果没开启force, init失败将会关闭pool
brutePool.Bar.Close()
brutePool.Close()
r.PrintStat(brutePool)
r.Done()
@ -253,6 +254,7 @@ Loop:
}
}
r.bar.Wait()
r.poolwg.Wait()
r.outwg.Wait()
}