Cyanty commented on code in PR #3777:
URL: https://github.com/apache/hertzbeat/pull/3777#discussion_r2362377132
##########
hertzbeat-collector/hertzbeat-collector-common/src/main/java/org/apache/hertzbeat/collector/timer/TimerDispatcher.java:
##########
@@ -153,9 +166,36 @@ public void responseSyncJobData(long jobId,
List<CollectRep.MetricsData> metrics
eventListener.response(metricsDataTemps);
}
}
-
+
@Override
public void destroy() throws Exception {
this.wheelTimer.stop();
}
+
+ public Long getNextExecutionInterval(Job job) {
+ if (ScheduleTypeEnum.CRON.getType().equals(job.getScheduleType()) &&
job.getCronExpression() != null && !job.getCronExpression().isEmpty()) {
+ try {
+ CronExpression cronExpression = new
CronExpression(job.getCronExpression());
Review Comment:
FYI, using `CronExpression` from `spring-context` is probably preferable
here. Quartz has slightly different cron semantics and would pull in an
unnecessary extra dependency.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]