Skip to content

Commit

Permalink
[Chore](Job)Add scheduling logs for periodic jobs.
Browse files Browse the repository at this point in the history
To facilitate troubleshooting and ensure the scheduler is functioning correctly.
  • Loading branch information
CalvinKirs committed Dec 2, 2024
1 parent 7526b9c commit e750846
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public void close() throws IOException {
private void cycleTimerJobScheduler(T job, long startTimeWindowMs) {
List<Long> delaySeconds = job.getJobConfig().getTriggerDelayTimes(System.currentTimeMillis(),
startTimeWindowMs, latestBatchSchedulerTimerTaskTimeMs);
log.info("job {} scheduler timer job, delay seconds is {}", job.getJobName(), delaySeconds);
if (CollectionUtils.isNotEmpty(delaySeconds)) {
delaySeconds.forEach(delaySecond -> {
TimerJobSchedulerTask<T> timerJobSchedulerTask = new TimerJobSchedulerTask<>(timerJobDisruptor, job);
Expand Down Expand Up @@ -186,6 +187,8 @@ private void executeTimerJobIdsWithinLastTenMinutesWindow() {
this.latestBatchSchedulerTimerTaskTimeMs = System.currentTimeMillis();
}
this.latestBatchSchedulerTimerTaskTimeMs += BATCH_SCHEDULER_INTERVAL_MILLI_SECONDS;
log.info("execute timer job ids within last ten minutes window, last time window is {}",
TimeUtils.longToTimeString(lastTimeWindowMs));
if (jobMap.isEmpty()) {
return;
}
Expand All @@ -207,6 +210,7 @@ private void clearEndJob(T job) {
}
try {
Env.getCurrentEnv().getJobManager().unregisterJob(job.getJobId());
log.info("clear finish job, job id is {}, job name is {}", job.getJobId(), job.getJobName());
} catch (JobException e) {
log.error("clear finish job error, job id is {}", job.getJobId(), e);
}
Expand Down

0 comments on commit e750846

Please sign in to comment.