mirror of
https://gitee.com/johng/gf.git
synced 2024-11-30 03:07:45 +08:00
improve package gcron/gtimer
This commit is contained in:
parent
7401fb09c9
commit
619e256138
@ -172,10 +172,11 @@ func (entry *Entry) check(ctx context.Context) {
|
||||
}
|
||||
entry.logDebugf(ctx, "[gcron] %s %s start", entry.schedule.pattern, entry.jobName)
|
||||
|
||||
entry.Job(entry.timerEntry.Ctx())
|
||||
entry.Job(ctx)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (entry *Entry) logDebugf(ctx context.Context, format string, v ...interface{}) {
|
||||
if logger := entry.cron.GetLogger(); logger != nil {
|
||||
logger.Debugf(ctx, format, v...)
|
||||
|
@ -16,7 +16,7 @@ import (
|
||||
// Entry is the timing job.
|
||||
type Entry struct {
|
||||
job JobFunc // The job function.
|
||||
ctx context.Context // The context for the job.
|
||||
ctx context.Context // The context for the job, for READ ONLY.
|
||||
timer *Timer // Belonged timer.
|
||||
ticks int64 // The job runs every tick.
|
||||
times *gtype.Int // Limit running times.
|
||||
|
Loading…
Reference in New Issue
Block a user