mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-22 23:51:27 +01:00
fix: make a new ctx when start scan all in async
Signed-off-by: He Weiwei <hweiwei@vmware.com>
This commit is contained in:
parent
30a89f2368
commit
3ba0d5a590
@ -286,7 +286,7 @@ func (bc *basicController) ScanAll(ctx context.Context, trigger string, async bo
|
||||
}
|
||||
|
||||
if async {
|
||||
go func() {
|
||||
go func(ctx context.Context) {
|
||||
// if async, this is running in another goroutine ensure the execution exists in db
|
||||
err := lib.RetryUntil(func() error {
|
||||
_, err := bc.execMgr.Get(ctx, executionID)
|
||||
@ -297,8 +297,8 @@ func (bc *basicController) ScanAll(ctx context.Context, trigger string, async bo
|
||||
return
|
||||
}
|
||||
|
||||
bc.startScanAll(bc.makeCtx(), executionID)
|
||||
}()
|
||||
bc.startScanAll(ctx, executionID)
|
||||
}(bc.makeCtx())
|
||||
} else {
|
||||
if err := bc.startScanAll(ctx, executionID); err != nil {
|
||||
return 0, err
|
||||
|
Loading…
Reference in New Issue
Block a user