Skip to content

Commit

Permalink
feat: change cron to every
Browse files Browse the repository at this point in the history
  • Loading branch information
nevo-david committed Feb 14, 2025
1 parent 4a787cc commit 76d3826
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ export class BullMqClient extends ClientProxy {
async dispatchEvent(packet: ReadPacket<any>): Promise<any> {
console.log('event to dispatch: ', packet);
const queue = this.getQueue(packet.pattern);
if (packet.data.options.cron) {
const { cron, immediately } = packet.data.options;
if (packet.data.options.every) {
const { every, immediately } = packet.data.options;
const id = packet.data.id ?? v4();
await queue.upsertJobScheduler(
id,
{ pattern: cron, ...(immediately ? { immediately } : {}) },
{ every, ...(immediately ? { immediately } : {}) },
{
name: id,
data: packet.data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class AutopostService {
return this._workerServiceProducer.emit('cron', {
id,
options: {
cron: '1 * * * *',
every: 3600000,
immediately: true,
},
payload: {
Expand Down

0 comments on commit 76d3826

Please sign in to comment.