#Cron Job in Nest back-end.
1 messages · Page 1 of 1 (latest)
Regarding file structure, if you inherited an existing code base, best ask the people that you inherited it from
Yes, I've just checked that post
It means bullmq and bull are not related to cron jobs? We have to use nest/schedule and create a external scheduling app (or use third-party service)?
Bullmq (the successor to bull) has a frature called scheduled jobs. Those can be used to run stuff periodically. It's most useful for stuff that is dynamically scheduled and should survive app restart.
Dynamic cron jobs from nestjs/schedule don't survive app restart, but it's more than enough for static jobs using the @Cron decorator.
You can check here file structure and event-cron-job.ts codes. As you can see, cron-jobs folder is outside of modules (app folder) and can't run that file via node cmd, als can't export function in current codes. And that code is enough for cronjobs using bullmq?
Whoever wrote that code should help you with that.
I see an IIFE there, that doesn't look very re-usable to me
That code seems like it runs once and puts the jobs to bull. Another application probably consumer that queue. That's as much as I can gather from the snippet
Yes, I am sorry to ask you about that. But I can't contact him right now, it's urgent for me. Hope you understand me.
And that's full codes. For cron jobs, how can I update codes? As you said, if we can run cron jobs using bullmq, where can I check doc for my problem?
I do understand, but you can't expect volunteers to solve urgent problems for you. I enjoy providing free NestJS comminity support in my own free time.
You can check docs of BullMQ on scheduled jobs or ask for (paid) help in #1096815728721666139