Skip to content

Job scheduling #3927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 14, 2017
Merged

Job scheduling #3927

merged 6 commits into from
Jun 14, 2017

Conversation

flovilmart
Copy link
Contributor

@flovilmart flovilmart commented Jun 14, 2017

I'm working on a JobScheduling worker (driven by a minute cron job on k8s) and I'd like to get back the original API's in. There is also a PR on the dashboard that restores the creation/update/delete of the _JobSchedule objects.

The _JobSchedule's Schema match the original parse.com api, so all original jobs should be editable.

TODO:

  • Add Tests

@codecov
Copy link

codecov bot commented Jun 14, 2017

Codecov Report

Merging #3927 into master will increase coverage by 0.11%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3927      +/-   ##
==========================================
+ Coverage    90.3%   90.41%   +0.11%     
==========================================
  Files         114      114              
  Lines        7641     7669      +28     
==========================================
+ Hits         6900     6934      +34     
+ Misses        741      735       -6
Impacted Files Coverage Δ
src/rest.js 97.18% <100%> (ø) ⬆️
src/Routers/CloudCodeRouter.js 100% <100%> (+57.14%) ⬆️
...dapters/Storage/Postgres/PostgresStorageAdapter.js 95.7% <100%> (ø) ⬆️
src/Controllers/SchemaController.js 97.05% <100%> (ø) ⬆️
src/RestWrite.js 92.92% <0%> (-0.4%) ⬇️
src/triggers.js 89.89% <0%> (+2.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9256b2d...7f2b675. Read the comment docs.

@flovilmart flovilmart force-pushed the job-scheduling-setup branch from 17fc4c7 to 41ceb83 Compare June 14, 2017 04:09
Copy link
Contributor

@acinader acinader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nice.

@flovilmart flovilmart merged commit f0949a1 into master Jun 14, 2017
@flovilmart flovilmart deleted the job-scheduling-setup branch June 14, 2017 18:07
@flovilmart flovilmart modified the milestone: 2.5.0 Jun 25, 2017
@tejpratap46
Copy link

Is there any documentation on how to implement this? I cannot find it on cloud code docs

@danibjor
Copy link

danibjor commented Jul 7, 2017 via email

@flovilmart
Copy link
Contributor Author

@tejpratap46 i’ve implemented a runner that fetches the scheduled jobs in the dashboard and runs them on a timely manner. The runner should be run every minutes or so in order to check if jobs have to be running.

@flovilmart
Copy link
Contributor Author

You can find it at https://github.com/ampme/Parse-server-job-runner

@SebC99
Copy link
Contributor

SebC99 commented Aug 28, 2017

Hello @flovilmart! Thanks for the link to your jobs scheduler. Could you explain a bit more how to use it? Does it need anything else? like a service/cron job/kue to work? And do you recommend to install it on a different server than the parse one?
If I understand well, your job-runner will look at scheduled jobs to see if any needs to be run, then run them. But then you still need to make the job-runner run at periodic time, don't you?
Thanks a lot for your help!

@flovilmart
Copy link
Contributor Author

Yes, you’re completely right, you need to schedule it and run it every minute for example. You can run it anywhere as it uses the HTTP api to communicate with Parse-server

@trylovetom
Copy link
Contributor

Great, I need it!!

@coderofsalvation
Copy link

coderofsalvation commented Apr 1, 2020

Awesome.

Is it an idea to ship this defaultJobRunner.js with the default parse-server package and run require('defaultJobRunner')(Parse) by default..unless env-var PARSE_REMOTE_JOBRUNNER=1 is set?

That will run scheduled jobs out of the box using the cron-package (which doesn't require cron).

REASON: the REST-api is a big step forward, however imho it still defeats the purpose of Parse being a batteries included solution. It results in every new parse-developer having to go down the 'why are my scheduled jobs not running'-rabbithole

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants