feat: run durable image worker locally
Quality / test (push) Canceled after 0s

This commit is contained in:
2026-09-08 22:06:28 -04:00
parent abd574293b
commit dd8af7c140
6 changed files with 108 additions and 2 deletions
@@ -110,4 +110,21 @@ export async function runImageDerivativeJob({ job, loadSource, processor }) {
failedAt: new Date(),
};
}
}
export async function processNextPersistentImageDerivativeJob({ jobRepository, loadSource, processor }) {
const claimed = await jobRepository.claimNext();
if (!claimed) return null;
const job = { ...claimed, type: 'IMAGE_DERIVATIVES' };
const result = await runImageDerivativeJob({ job, loadSource, processor });
if (result.status === 'COMPLETED') {
await jobRepository.complete(claimed.id, result.derivatives);
} else {
await jobRepository.fail(claimed.id, result.error);
}
return result;
}