mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 12:15:20 +01:00
Change the log to logger in purge job (#17162)
Fixes #17151 Signed-off-by: stonezdj <stonezdj@gmail.com>
This commit is contained in:
parent
3f383e3ffd
commit
9a41272986
@ -17,7 +17,6 @@ package purge
|
||||
import (
|
||||
"github.com/goharbor/harbor/src/common"
|
||||
"github.com/goharbor/harbor/src/jobservice/job"
|
||||
"github.com/goharbor/harbor/src/lib/log"
|
||||
"github.com/goharbor/harbor/src/pkg/audit"
|
||||
"os"
|
||||
"strings"
|
||||
@ -93,13 +92,13 @@ func (j *Job) Run(ctx job.Context, params job.Parameters) error {
|
||||
logger.Info("Purge audit job start")
|
||||
logger.Infof("job parameters %+v", params)
|
||||
if j.shouldStop(ctx) {
|
||||
log.Info("received the stop signal, stop the purge job")
|
||||
logger.Info("received the stop signal, stop the purge job")
|
||||
return nil
|
||||
}
|
||||
j.parseParams(params)
|
||||
ormCtx := ctx.SystemContext()
|
||||
if j.retentionHour == -1 || j.retentionHour == 0 {
|
||||
log.Infof("quit purge job, retentionHour:%v ", j.retentionHour)
|
||||
logger.Infof("quit purge job, retentionHour:%v ", j.retentionHour)
|
||||
return nil
|
||||
}
|
||||
n, err := j.auditMgr.Purge(ormCtx, j.retentionHour, j.includeOperations, j.dryRun)
|
||||
|
Loading…
Reference in New Issue
Block a user