#Canceling a job

4 messages · Page 1 of 1 (latest)

warped dragon
#

I'm trying to cancel a job using payload.jobs.cancel, with a where clause filtering by the data I'm saving in the queue. But for some reason, the query goes through sanitizeQueryValue which is expecting a collection/global and throws an error because I have no 'fields'. I'm simply storing an ID and collection name (or global name).
I'm a little surprised the test is passing for db-mongodb, since it is also only using an ID, but maybe its being handled differently.

Is someone else able to cancel jobs similar to this?
Here is the error: TypeError: Cannot read properties of undefined (reading 'type') at sanitizeQueryValue

graceful hawkBOT
warped dragon
#

I'm currently trying to dedupe jobs, since this is not working, instead I'm going to let running jobs continue and only queue a new one if there is not an existing one waiting.

#

Except that is not going to work because task cannot be queried....