(jobId, attempt)
| 1055 | } |
| 1056 | |
| 1057 | scheduleSaveRetry(jobId, attempt) { |
| 1058 | const job = this.jobs[jobId]; |
| 1059 | if (!job) { |
| 1060 | logger.warn({ jobId }, 'Cannot schedule retry for missing job'); |
| 1061 | return; |
| 1062 | } |
| 1063 | |
| 1064 | const retryDelay = 1000 * attempt; // Exponential backoff: 1s, 2s, 3s |
| 1065 | logger.info({ jobId, attempt, maxRetries: MAX_SAVE_RETRIES, retryDelay }, 'Will retry save for job'); |
| 1066 | |
| 1067 | setTimeout(() => { |
| 1068 | this.runSaveRetry(jobId, attempt); |
| 1069 | }, retryDelay); |
| 1070 | } |
| 1071 | |
| 1072 | async runSaveRetry(jobId, attempt) { |
| 1073 | const jobBeforeRetry = this.jobs[jobId]; |
no test coverage detected