mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-09 00:12:03 +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 {
|
if async {
|
||||||
go func() {
|
go func(ctx context.Context) {
|
||||||
// if async, this is running in another goroutine ensure the execution exists in db
|
// if async, this is running in another goroutine ensure the execution exists in db
|
||||||
err := lib.RetryUntil(func() error {
|
err := lib.RetryUntil(func() error {
|
||||||
_, err := bc.execMgr.Get(ctx, executionID)
|
_, err := bc.execMgr.Get(ctx, executionID)
|
||||||
@ -297,8 +297,8 @@ func (bc *basicController) ScanAll(ctx context.Context, trigger string, async bo
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
bc.startScanAll(bc.makeCtx(), executionID)
|
bc.startScanAll(ctx, executionID)
|
||||||
}()
|
}(bc.makeCtx())
|
||||||
} else {
|
} else {
|
||||||
if err := bc.startScanAll(ctx, executionID); err != nil {
|
if err := bc.startScanAll(ctx, executionID); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
|
Loading…
Reference in New Issue
Block a user