We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I was wondering if the expire_in_seconds should set a job's state to expired instead of error here:
expire_in_seconds
expired
pg-boss/src/manager.js
Lines 225 to 227 in f1c1636
I was able to get an exipired state only when the job is active and I stop and restart pg-boss. Is this expected?
exipired
Example:
'use strict'; const PgBoss = require('pg-boss'); buildConsumer(); async function buildConsumer () { const boss = new PgBoss({ user: 'postgres', password: 'postgres', schema: 'postgres', }); await boss.start(); const jobId = await boss.send('queueName', { body: 'foo' }, { expireInSeconds: 2 }); console.log('📣 Inserted job'); await boss.work( 'queueName', { teamSize: 1, newJobCheckInterval: 100, }, async () => { console.log('🐌 Started SLOW job'); await new Promise((resolve) => setTimeout(resolve, 5_000)); console.log('Done job'); const job = await boss.getJobById(jobId); console.log({ job }); // ❗️ state: 'failed', message: 'handler execution exceeded 2000ms' }, ); console.log('📣 Start worker'); process.on('SIGINT', async () => { console.log('📣 Stopping'); await boss.stop(); console.log('📣 Stopped'); process.exit(); }); }
The text was updated successfully, but these errors were encountered:
The expired state will be obsolete in v10 to make this more consistent
Sorry, something went wrong.
No branches or pull requests
I was wondering if the
expire_in_seconds
should set a job's state toexpired
instead of error here:pg-boss/src/manager.js
Lines 225 to 227 in f1c1636
I was able to get an
exipired
state only when the job is active and I stop and restart pg-boss. Is this expected?Example:
The text was updated successfully, but these errors were encountered: