Skip to content
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

Adding clockwork to recurrently fetch feeds #430

Closed

Conversation

fearenales
Copy link
Contributor

@fearenales fearenales commented Mar 30, 2016

This PR intends to add clockwork gem to recurrently fetch feeds.

It will replace Scheduler (for deployment on Heroku), so that no extra step is needed due to another spawn command being called on unicorn.rb starting clockwork.

Still on Heroku, Procfile is updated, describing the worker and clock components (if the user wants a more robust architecture). This fixes #411

Also, for development environments, it will allow fetching feeds without manually running rake commands.

The default interval for fetching feeds is 10 min and it can be customized by env var FETCH_INTERVAL.

@@ -27,6 +27,7 @@ end
gem "activerecord", "~> 4.1.11"
gem "arel", "~> 5.0"
gem "bcrypt-ruby", "~> 3.1.2"
gem "clockwork", "~> 1.2.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we lock this gem at the major version, see c3e41b4?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! :)

@Koronen
Copy link
Contributor

Koronen commented May 3, 2016

I can see this being a useful changeset. Thank you for your contribution! I'll give this a spin on my instance.

@Koronen
Copy link
Contributor

Koronen commented May 3, 2016

Hmm... One issue with these changes is that for the app to be fully functional on Heroku without using the embedded workers, you would have to run three dynos. Heroku only allows for two concurrent Free-size dynos. Any thoughts on this?

It will replace Scheduler (for deployment on Heroku), so that no extra step is
needed due to another spawn command being called on unicorn.rb starting
clockwork.

Still on Heroku, Procfile is updated, describing the worker and clock
components (if the user wants a more robust architecture).
This fixes stringer-rss#411

Also, for development environments, it will allow fetching feeds without
having to manually running rake commands.

The default interval for fetching feeds is 10 min and it can be customized
by env var FETCH_INTERVAL.
@fearenales
Copy link
Contributor Author

fearenales commented May 6, 2016

@Koronen Why not using embedded workers on Heroku? That should work.
And if you need a more robust infrastructure, just deploy 3 dynos.

Unless we use one dyno for the web system and another for the clock + worker (running in background).

@swanson
Copy link
Collaborator

swanson commented May 6, 2016

I'm not sure what adding clockwork gets us -- Heroku (the preferred deployment platform) offers a robust scheduler already and any other Unix-y platform will have a cronjob service. I don't like taking dependencies in the project if we can avoid it.

@gabrielpoca
Copy link
Contributor

I'm closing this pull request for lack of activity.

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.

Improve robustness of rake work_jobs
4 participants