Skip to content

Commit

Permalink
Don't use hazelcast executor in task scheduling #10122
Browse files Browse the repository at this point in the history
  • Loading branch information
vbradnitski committed Apr 21, 2023
1 parent 6479f15 commit dd72cf7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ private static void scheduleOneTimeJobs( final Map<ScheduledJobName, ScheduledJo
private static void scheduleCronJobs( final Map<ScheduledJobName, ScheduledJob> jobs, final Instant now,
final Predicate<ScheduledJob> filterAlreadyScheduled )
{
jobs.values().stream().filter( ScheduledJob::isEnabled ).filter( filterAlreadyScheduled )
jobs.values()
.stream()
.filter( ScheduledJob::isEnabled )
.filter( filterAlreadyScheduled )
.filter( job -> ScheduleCalendarType.CRON.equals( job.getCalendar().getType() ) )
.forEach( job -> {
final Instant actualLastRun = job.getLastRun();
Expand Down Expand Up @@ -211,6 +214,7 @@ private void retryFailedJobs( final List<JobToRun> failedJobs )
if ( entity.attempts < 10 )
{
QUEUE.offer( new JobToRun( entity.name, entity.timeToRun, entity.attempts + 1 ) );
LOG.warn( "Error while running job [{}], will try to run once more", entity.name );
}
else
{
Expand Down

0 comments on commit dd72cf7

Please sign in to comment.