This commit is contained in:
leif stawnyczy 2024-04-02 10:57:29 -04:00
parent 7f6d1aa9c7
commit e61f38eea9
2 changed files with 5 additions and 8 deletions

View File

@ -363,10 +363,7 @@ public class JpaJobPersistenceImpl implements IJobPersistence {
@Override
public void onWorkChunkPollDelay(String theChunkId, Date theDeadline) {
int updated = myWorkChunkRepository.updateWorkChunkNextPollTime(
theChunkId,
WorkChunkStatusEnum.POLL_WAITING,
Set.of(WorkChunkStatusEnum.IN_PROGRESS),
theDeadline);
theChunkId, WorkChunkStatusEnum.POLL_WAITING, Set.of(WorkChunkStatusEnum.IN_PROGRESS), theDeadline);
if (updated != 1) {
ourLog.warn("Expected to update 1 work chunk's poll delay; but found {}", updated);

View File

@ -63,10 +63,10 @@ public class StepExecutor {
outcome = theStepWorker.run(theStepExecutionDetails, theDataSink);
Validate.notNull(outcome, "Step theWorker returned null: %s", theStepWorker.getClass());
} catch (RetryChunkLaterException ex) {
Date nextPollTime = Date.from(
Instant.now().plus(ex.getNextPollDuration())
);
ourLog.debug("Polling job encountered; will retry after {}s", ex.getNextPollDuration().get(ChronoUnit.SECONDS));
Date nextPollTime = Date.from(Instant.now().plus(ex.getNextPollDuration()));
ourLog.debug(
"Polling job encountered; will retry after {}s",
ex.getNextPollDuration().get(ChronoUnit.SECONDS));
myJobPersistence.onWorkChunkPollDelay(theStepExecutionDetails.getChunkId(), nextPollTime);
return false;
} catch (JobExecutionFailedException e) {