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 @Override
public void onWorkChunkPollDelay(String theChunkId, Date theDeadline) { public void onWorkChunkPollDelay(String theChunkId, Date theDeadline) {
int updated = myWorkChunkRepository.updateWorkChunkNextPollTime( int updated = myWorkChunkRepository.updateWorkChunkNextPollTime(
theChunkId, theChunkId, WorkChunkStatusEnum.POLL_WAITING, Set.of(WorkChunkStatusEnum.IN_PROGRESS), theDeadline);
WorkChunkStatusEnum.POLL_WAITING,
Set.of(WorkChunkStatusEnum.IN_PROGRESS),
theDeadline);
if (updated != 1) { if (updated != 1) {
ourLog.warn("Expected to update 1 work chunk's poll delay; but found {}", updated); 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); outcome = theStepWorker.run(theStepExecutionDetails, theDataSink);
Validate.notNull(outcome, "Step theWorker returned null: %s", theStepWorker.getClass()); Validate.notNull(outcome, "Step theWorker returned null: %s", theStepWorker.getClass());
} catch (RetryChunkLaterException ex) { } catch (RetryChunkLaterException ex) {
Date nextPollTime = Date.from( Date nextPollTime = Date.from(Instant.now().plus(ex.getNextPollDuration()));
Instant.now().plus(ex.getNextPollDuration()) ourLog.debug(
); "Polling job encountered; will retry after {}s",
ourLog.debug("Polling job encountered; will retry after {}s", ex.getNextPollDuration().get(ChronoUnit.SECONDS)); ex.getNextPollDuration().get(ChronoUnit.SECONDS));
myJobPersistence.onWorkChunkPollDelay(theStepExecutionDetails.getChunkId(), nextPollTime); myJobPersistence.onWorkChunkPollDelay(theStepExecutionDetails.getChunkId(), nextPollTime);
return false; return false;
} catch (JobExecutionFailedException e) { } catch (JobExecutionFailedException e) {