reconcileInterruptedJobs method

Future<void> reconcileInterruptedJobs()

Flips every job left in JobStatus.running (a render the previous process never finished) to JobStatus.failed.

Implementation

Future<void> reconcileInterruptedJobs() async {
  for (final job in await _all()) {
    if (job.status == JobStatus.running) {
      await update(job.copyWith(status: JobStatus.failed, error: 'Server restarted mid-render'));
    }
  }
}