aquint
aquint

Reputation: 512

User Created Job Scheduling

I'm currently in the process of building an app in MeteorJS that allows users to create jobs and schedule them, e.g. Posting a link to social media every 2 hours. Are there any Meteor or Node packages that would make this possible? I've looked into https://github.com/percolatestudio/meteor-synced-cron, but I'm not sure that this would be the right approach for user submitted jobs (seems to be for jobs you create on app start-up). The idea would be that users could create these jobs and delete them later.

Thanks!

Upvotes: 0

Views: 73

Answers (2)

Datsik
Datsik

Reputation: 14824

You can use a setInterval(); to loop every so often, maybe query a database or something for entries that are over 2 hours old, then act on them.

Upvotes: 1

416serg
416serg

Reputation: 448

I've used https://github.com/percolatestudio/meteor-synced-cron in an app to check if invoices are due and then fire up email reminders. The jobs run on startup but if you set it to go through the collection of jobs, check the time they were created, and then fire something 2 hours after the creation, I'm sure you'll be able to get the work you need done

Upvotes: 1

Related Questions