Skip to content

Commit 76d3826

Browse files
committed
feat: change cron to every
1 parent 4a787cc commit 76d3826

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libraries/nestjs-libraries/src/bull-mq-transport-new/client.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ export class BullMqClient extends ClientProxy {
8080
async dispatchEvent(packet: ReadPacket<any>): Promise<any> {
8181
console.log('event to dispatch: ', packet);
8282
const queue = this.getQueue(packet.pattern);
83-
if (packet.data.options.cron) {
84-
const { cron, immediately } = packet.data.options;
83+
if (packet.data.options.every) {
84+
const { every, immediately } = packet.data.options;
8585
const id = packet.data.id ?? v4();
8686
await queue.upsertJobScheduler(
8787
id,
88-
{ pattern: cron, ...(immediately ? { immediately } : {}) },
88+
{ every, ...(immediately ? { immediately } : {}) },
8989
{
9090
name: id,
9191
data: packet.data,

libraries/nestjs-libraries/src/database/prisma/autopost/autopost.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export class AutopostService {
101101
return this._workerServiceProducer.emit('cron', {
102102
id,
103103
options: {
104-
cron: '1 * * * *',
104+
every: 3600000,
105105
immediately: true,
106106
},
107107
payload: {

0 commit comments

Comments
 (0)