Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mirror:Add the printing of time in non-event #5124

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions cmd/mirror-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,10 @@ var (
)
)

const uaMirrorAppName = "mc-mirror"
const (
uaMirrorAppName = "mc-mirror"
mirrorTimeFormat = "2006-01-02T15:04:05.000Z"
)

type mirrorJob struct {
stopCh chan struct{}
Expand Down Expand Up @@ -841,11 +844,11 @@ func (mj *mirrorJob) startMirror(ctx context.Context) {

if sURLs.SourceContent != nil {
mj.parallel.queueTask(func() URLs {
return mj.doMirror(ctx, sURLs, EventInfo{})
return mj.doMirror(ctx, sURLs, EventInfo{Time: time.Now().Local().Format(mirrorTimeFormat)})
}, sURLs.SourceContent.Size)
} else if sURLs.TargetContent != nil && mj.opts.isRemove {
mj.parallel.queueTask(func() URLs {
return mj.doRemove(ctx, sURLs, EventInfo{})
return mj.doRemove(ctx, sURLs, EventInfo{Time: time.Now().Local().Format(mirrorTimeFormat)})
}, 0)
}
case <-ctx.Done():
Expand Down
Loading