feat: update

This commit is contained in:
Rogee
2025-09-10 18:06:24 +08:00
parent 66deb69c32
commit 1306a5bec0
4 changed files with 16 additions and 20 deletions

View File

@@ -40,14 +40,14 @@ func (w *DemoJobWorker) NextRetry(job *Job[DemoJob]) time.Time {
}
func (w *DemoJobWorker) Work(ctx context.Context, job *Job[DemoJob]) error {
log = log.WithField("job", job.Kind())
logger := log.WithField("job", job.Args.Kind())
log.Infof("[START] %s args: %v", job.Kind(), job.Args.Strings)
defer log.Infof("[END] %s", job.Kind())
logger.Infof("[START] %s args: %v", job.Args.Kind(), job.Args.Strings)
defer logger.Infof("[END] %s", job.Args.Kind())
// modify below
sort.Strings(job.Args.Strings)
log.Infof("[%s] Sorted strings: %v\n", time.Now().Format(time.TimeOnly), job.Args.Strings)
logger.Infof("[%s] Sorted strings: %v\n", time.Now().Format(time.TimeOnly), job.Args.Strings)
return nil
}