I’m building an app that needs to change the “checked” field in my players collection from true to false at midnight each night. I would normally use a cron job and an if statement to check if it is currently set to “true”
Being new to meteor is that the best way to accomplish it in Meteor? I know the if statement will work, but just wondering about the cron job. If so do any of you use any of the jobs packages in atmosphere?
Thanks for the help in advance.
Yep, sounds like a good plan to me - this is one of the best cron packages - percolate:synced-cron (so good in fact that it helped get its creators purchased by MDG themselves! Okay, well maybe not just this package …).
Awesome! thanks for the reassurance and the package. I was looking at that one and a few others, but that one seemed like the best and had the most installs
I ended up using chfritz:easycron package because it was pretty lightweight and fit the bill for what I needed. Created a cron.js file in my /server directory and all the logic in there. If your not familiar with cron or using this tool in the /server directory , when you call console.log(‘whatever’), it shows up in you meteor terminal not your browser console. So make sure your checking that.