Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Schedule periodic tasks centrally #1978

Closed
ianb opened this issue Nov 15, 2016 · 4 comments
Closed

Schedule periodic tasks centrally #1978

ianb opened this issue Nov 15, 2016 · 4 comments
Assignees
Milestone

Comments

@ianb
Copy link
Contributor

ianb commented Nov 15, 2016

We have a couple periodic tasks. Right now these are done with setInterval() in the JS code. This is lame and actually incorrect in production, with multiple application servers running. How should we run these?

If we could leave the work in the application server, but trigger it via an HTTP request (authenticated in some fashion?) that might be best/easiest/most reliable. @relud: thoughts?

@relud
Copy link
Member

relud commented Nov 15, 2016

We could set up a single server to behave differently from the rest and have cron tasks on it. It would be configured such that there is only one, and could be the same server that #1977 gets run on.

Ideally the tasks that it runs would gracefully handle being missed once, or being run an extra time, and the upgrade process for it would make sure there are always at least one, or at most one, of these servers accordingly.

@ianb
Copy link
Contributor Author

ianb commented Nov 16, 2016

All the periodic tasks can be run extra times without a problem. Will the special server just get a different environmental variable that will tell it to act differently?

@relud
Copy link
Member

relud commented Nov 16, 2016

yeah, and it could be either one of the servers in the ELB, or a separate server (like if we have an admin node)

@ianb ianb modified the milestone: Deneb Nov 28, 2016
@ianb ianb self-assigned this Dec 13, 2016
@ianb
Copy link
Contributor Author

ianb commented Dec 13, 2016

I did this in 2d4df88 and if the variable CONTROLLER_SINGLETON=true is present then periodic tasks will be performed by this server.

@fzzzy fzzzy closed this as completed in 2d4df88 Dec 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants