My app has some heavy work that needs to happen once or twice a week.
If the app shuts down for some reason and doesn’t perform the task for when it was scheduled, it will do the work on startup. The problem is that when it’s doing this work, no one can access the website. Till now it’s been in a Meteor.startup block, but I’ve also tried putting it in a setTimeout method with a 1ms timeout, and calling a method on startup and then using this.unblock(), but none of these methods work.
Once this heavy function is running, the site is inaccessible. Any ideas of a way around this? Or how I can run the work in a new “thread”?