codemem 0.30.0-alpha.4 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3200,28 +3200,27 @@ function createSequentialBackfillCoordinator(store, jobPlans, options) {
3200
3200
  };
3201
3201
  const waitForCurrentJob = () => {
3202
3202
  if (stopped || options.signal?.aborted || !activePlan || !activeRunner) return;
3203
- const job = getMaintenanceJob(store.db, activePlan.kind);
3204
- if (!activePlan.isPending(store.db)) {
3205
- const finishedPlan = activePlan;
3206
- const finishedRunner = activeRunner;
3203
+ if (getMaintenanceJob(store.db, activePlan.kind)?.status === "failed") {
3204
+ const failedPlan = activePlan;
3205
+ const failedRunner = activeRunner;
3207
3206
  activePlan = null;
3208
3207
  activeRunner = null;
3209
- finishedRunner.stop().finally(() => {
3208
+ failedRunner.stop().finally(() => {
3210
3209
  if (!stopped && !options.signal?.aborted) {
3211
- options.logger.step(`${finishedPlan.name} backfill complete`);
3210
+ options.logger.warn(`${failedPlan.name} backfill failed and will be retried on a later startup`);
3212
3211
  startNextJob();
3213
3212
  }
3214
3213
  });
3215
3214
  return;
3216
3215
  }
3217
- if (job?.status === "failed") {
3218
- const failedPlan = activePlan;
3219
- const failedRunner = activeRunner;
3216
+ if (!activePlan.isPending(store.db)) {
3217
+ const finishedPlan = activePlan;
3218
+ const finishedRunner = activeRunner;
3220
3219
  activePlan = null;
3221
3220
  activeRunner = null;
3222
- failedRunner.stop().finally(() => {
3221
+ finishedRunner.stop().finally(() => {
3223
3222
  if (!stopped && !options.signal?.aborted) {
3224
- options.logger.warn(`${failedPlan.name} backfill failed and will be retried on a later startup`);
3223
+ options.logger.step(`${finishedPlan.name} backfill complete`);
3225
3224
  startNextJob();
3226
3225
  }
3227
3226
  });