mirror of
https://github.com/samuelncui/acp.git
synced 2026-01-08 12:01:12 +00:00
feat: add wrap for panic
This commit is contained in:
@@ -44,7 +44,7 @@ func (c *Copyer) startProgressBar(ctx context.Context) {
|
||||
ch <- func() { logrus.StandardLogger().Logf(l, format, args...) }
|
||||
}
|
||||
|
||||
go func() {
|
||||
go wrap(ctx, func() {
|
||||
copying := make(map[int64]struct{}, c.threads)
|
||||
|
||||
for f := range ch {
|
||||
@@ -77,9 +77,9 @@ func (c *Copyer) startProgressBar(ctx context.Context) {
|
||||
v()
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
|
||||
go func() {
|
||||
go wrap(ctx, func() {
|
||||
defer close(ch)
|
||||
|
||||
ticker := time.NewTicker(barUpdateInterval) // around 255ms, avoid conflict with progress bar fresh by second
|
||||
@@ -112,5 +112,5 @@ func (c *Copyer) startProgressBar(ctx context.Context) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user