Issue
I'm facing a problem in running the Nest JS cron job in sync with Mysql database. The problem right now is once the server gets restarted all the cron jobs are lost. What is the best way to get the existing cron jobs which was set before ?
Solution
The only way that I found it's creating a crons table in the db and use the OnModuleInit provided by NestJS and retrieve all the crons from DB and run them inside the OnModuleInit method.
Answered By - Alex Muñoz Answer Checked By - Marie Seifert (WPSolving Admin)