mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 20:26:13 +01:00
Merge pull request #14875 from heww/fix-scan-all
fix: using new ctx to scan artifact when scanAll
This commit is contained in:
commit
35c9a98272
@ -327,7 +327,7 @@ func (bc *basicController) startScanAll(ctx context.Context, executionID int64)
|
||||
return bc.Scan(ctx, artifact, WithExecutionID(executionID))
|
||||
}
|
||||
|
||||
if err := orm.WithTransaction(scan)(ctx); err != nil {
|
||||
if err := orm.WithTransaction(scan)(bc.makeCtx()); err != nil {
|
||||
// Just logged
|
||||
log.Errorf("failed to scan artifact %s, error %v", artifact, err)
|
||||
|
||||
|
@ -278,7 +278,7 @@ func (suite *ControllerTestSuite) SetupSuite() {
|
||||
},
|
||||
|
||||
cloneCtx: func(ctx context.Context) context.Context { return ctx },
|
||||
makeCtx: func() context.Context { return context.TODO() },
|
||||
makeCtx: func() context.Context { return orm.NewContext(nil, &ormtesting.FakeOrmer{}) },
|
||||
|
||||
execMgr: suite.execMgr,
|
||||
taskMgr: suite.taskMgr,
|
||||
|
Loading…
Reference in New Issue
Block a user