Skip to content

Commit

Permalink
Not an ideal fix. Request discussion further
Browse files Browse the repository at this point in the history
  • Loading branch information
lonicerae committed Apr 24, 2023
1 parent 0ba39b0 commit a1109bd
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions action.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,20 +898,12 @@ actionDoRetry(action_t * const pThis, wti_t * const pWti)
++iRetries;
datetime.GetTime(&ttTemp);
iSleepPeriod = 0;
DBGPRINTF("actionDoRetry: %s ResumeRtry=%lld"
"(now %lld), iRetries %d\n",
pThis->pszName, (long long)pThis->ttResumeRtry,
(long long)ttTemp, iRetries);
if(pThis->ttResumeRtry > 0 && pThis->iResumeInterval > 0) {
if(difftime(pThis->ttResumeRtry, ttTemp) > pThis->iResumeInterval) {
iSleepPeriod = pThis->iResumeInterval;
} else if(difftime(pThis->ttResumeRtry, ttTemp) > 1) {
iSleepPeriod = (int)difftime(pThis->ttResumeRtry, ttTemp);
}
DBGPRINTF("actionDoRetry: %s sleep %d seconds\n",
pThis->pszName, iSleepPeriod);
srSleep(iSleepPeriod, 0);
}
DBGPRINTF("actionDoRetry: %s, controlled by resumeInterval, may miss the next try."
"Will sleep %d seconds. ResumeRtry=%lld (now %lld), iRetries %d\n",
pThis->pszName,
pThis->iResumeInterval, (long long)pThis->ttResumeRtry, (long long)ttTemp, iRetries);
iSleepPeriod = pThis->iResumeInterval;
srSleep(iSleepPeriod, 0);
if(*pWti->pbShutdownImmediate) {
ABORT_FINALIZE(RS_RET_FORCE_TERM);
}
Expand Down

0 comments on commit a1109bd

Please sign in to comment.