feat: bound pricing job retries
Quality / test (push) Canceled after 0s

This commit is contained in:
2026-09-09 18:02:35 -04:00
parent 22d13af604
commit b58b84a81e
7 changed files with 65 additions and 10 deletions
@@ -62,3 +62,17 @@ test('persists completed and failed outcomes through the job repository', async
assert.deepEqual(calls, [['complete', 'job-3', [{ id: 'observation-1' }], { valueMinor: 2500 }]]);
});
test('persists failed pricing refresh outcomes through the repository', async () => {
const calls = [];
await processNextPersistentPricingRefreshJob({
jobRepository: {
async claimNext() { return { id: 'job-4' }; },
async complete() { throw new Error('not expected'); },
async fail(id, error) { calls.push([id, error]); },
},
async pricingRefreshJob() { return { status: 'FAILED', error: 'Provider unavailable.' }; },
});
assert.deepEqual(calls, [['job-4', 'Provider unavailable.']]);
});