timgit / pg-boss

Queueing jobs in Postgres from Node.js like a boss
MIT License
2.04k stars 157 forks source link

Error when trying to send the data to be handled. #470

Closed oindrila-b closed 3 weeks ago

oindrila-b commented 3 weeks ago

So I have installed the latest version of PgBoss and I tried following the docs to setup my project with pgBoss. I figured out the handler part but when I try to add a job through the send method:

const id = await pgBoss.send(queue, {name:"jane"})

I got this error:

371 | retryBackoff, // 18 372 | retryBackoffDefault // 19 373 | ] 374 | 375 | const db = wrapper || this.db 376 | const { rows } = await db.executeSql(this.insertJobCommand, values) ^ TypeError: Right side of assignment cannot be destructured at /home/user/projects/node_projects/queue/packages/taskQueue/node_modules/pg-boss/src/manager.js:376:31

Is there a different way we need to add the jobs now?

timgit commented 3 weeks ago

It looks like you set the db option and it doesn't have the required interface