Originally posted by **alyatwa** June 9, 2023
if I want to update startAfter date currently I cancel running job and send it again to the queue, is there better way to do this?
```js
const jobQuery = `SELECT * FROM "pgboss"."job" WHERE "singletonkey"='onEventEndedQueue-${event.id}';`
const result: any = await pgClient.query(jobQuery)
if (result.rows.length > 0) {
let jobs = result.rows.map((a: JobType) => a.id)
await boss.cancel(jobs)
}
//////////////
await boss.sendAfter(
onEventEndedQueue,
{ eventId: event.id },
{
singletonKey: `${onEventEndedQueue}-${event.id}`,
},
event.endDate
)
```
Discussed in https://github.com/timgit/pg-boss/discussions/398