mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-29 21:54:13 +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 (
|
import (
|
||||||
"github.com/goharbor/harbor/src/common"
|
"github.com/goharbor/harbor/src/common"
|
||||||
"github.com/goharbor/harbor/src/jobservice/job"
|
"github.com/goharbor/harbor/src/jobservice/job"
|
||||||
"github.com/goharbor/harbor/src/lib/log"
|
|
||||||
"github.com/goharbor/harbor/src/pkg/audit"
|
"github.com/goharbor/harbor/src/pkg/audit"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
@ -93,13 +92,13 @@ func (j *Job) Run(ctx job.Context, params job.Parameters) error {
|
|||||||
logger.Info("Purge audit job start")
|
logger.Info("Purge audit job start")
|
||||||
logger.Infof("job parameters %+v", params)
|
logger.Infof("job parameters %+v", params)
|
||||||
if j.shouldStop(ctx) {
|
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
|
return nil
|
||||||
}
|
}
|
||||||
j.parseParams(params)
|
j.parseParams(params)
|
||||||
ormCtx := ctx.SystemContext()
|
ormCtx := ctx.SystemContext()
|
||||||
if j.retentionHour == -1 || j.retentionHour == 0 {
|
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
|
return nil
|
||||||
}
|
}
|
||||||
n, err := j.auditMgr.Purge(ormCtx, j.retentionHour, j.includeOperations, j.dryRun)
|
n, err := j.auditMgr.Purge(ormCtx, j.retentionHour, j.includeOperations, j.dryRun)
|
||||||
|
Loading…
Reference in New Issue
Block a user