Skip to content

Commit

Permalink
fix: remove repeatable job
Browse files Browse the repository at this point in the history
* fix: return non nullable key field

* feat: right method for delete removeRepeatable

Co-authored-by: Boris Dorofeev <bdorofeev@bdorofeev-laptop.corp.ps.kz>
  • Loading branch information
intpro and Boris Dorofeev authored May 13, 2020
1 parent 9d40bf6 commit f9cc7c5
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/mutation/queueRemoveRepeatable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,28 @@ export function createRemoveRepeatableFC(
return {
type: sc.createObjectTC({
name: `${typePrefix}QueueRemoveRepeatablePayload`,
fields: {
key: 'String!',
},
}),
args: {
prefix: {
type: 'String!',
defaultValue: 'bull',
},
queueName: 'String!',
key: 'String!',
jobName: 'String',
repeat: sc.createInputTC({
name: `${typePrefix}JobOptionsInputRepeatRemove`,
fields: {
tz: 'String',
endDate: 'Date',
cron: 'String',
every: 'String',
},
}).NonNull,
},
resolve: async (_, { prefix, queueName, key }) => {
resolve: async (_, { prefix, queueName, jobName, repeat }) => {
const queue = await findQueue(prefix, queueName, opts);
await queue.removeRepeatableByKey(key);
return { key };
await queue.removeRepeatable(jobName, repeat);
return {};
},
};
}

0 comments on commit f9cc7c5

Please sign in to comment.