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

Added whenever gem for easily writing and deploying cron jobs #2706

Merged
merged 2 commits into from
May 10, 2018

Conversation

namangupta01
Copy link
Member

@namangupta01 namangupta01 commented May 9, 2018

Added whenever gem for easily writing and deploying cron jobs
Sub-project part of Periodic Email Digests in #2104

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • PR body includes fixes #0000-style reference to original issue #
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

We have a loose schedule of reviewing and pulling in changes every Tuesday and Friday, and publishing changes on Fridays.

Thanks!

@PublicLabBot
Copy link

PublicLabBot commented May 9, 2018

1 Message
📖 @namangupta01 Thank you for your pull request! I’m here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution! And don’t be discouraged if you see errors – we’re here to help.

Generated by 🚫 Danger

@namangupta01 namangupta01 requested review from jywarren and a team May 9, 2018 17:56
Copy link
Member

@SidharthBansal SidharthBansal left a comment

Choose a reason for hiding this comment

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

Looks good to me

@jywarren
Copy link
Member

jywarren commented May 9, 2018

Awesome! @icarito ?

@icarito
Copy link
Member

icarito commented May 10, 2018

Hi!
Great to see this moving forward! I guess we need to include cron daemon in the production container.
The issue with that is that cron will live in the same container and thus when we redeploy the cron jobs will be lost. In addition to adding crond to Dockerfile I think we'll need to figure out when to run the whenever --update-crontab command.

@icarito
Copy link
Member

icarito commented May 10, 2018

I've added the cron daemon to our Docker definition - so the gem should work - but we still need to figure out when to run whenever --update-crontab.

@namangupta01
Copy link
Member Author

namangupta01 commented May 10, 2018 via email

@icarito
Copy link
Member

icarito commented May 10, 2018 via email

@jywarren
Copy link
Member

Should we test this by pushing it to unstable first? I mean, if it's not going to break anything, we can just merge it. But that's always an option. @namangupta01 what is the first time we'd actually see this thing start to run and how would we know? Can we, for example, have it do a cron job that puts a timestamp into a text file in a public folder like /public/time.txt so we can sort of confirm it's working in the staging server? (as a follow-up issue to this)?

@namangupta01
Copy link
Member Author

yes we can have a cron job that put timestamp in the text file.

@namangupta01
Copy link
Member Author

namangupta01 commented May 10, 2018

Should i add that example in this pr? I mean cron job. We will actually see this running once we implement reply by tweet and email digest.

@jywarren
Copy link
Member

jywarren commented May 10, 2018 via email

@namangupta01
Copy link
Member Author

I will add a job into the config/schedule file using ruby code.

@namangupta01
Copy link
Member Author

After this we could also do testing for whenever using this gem https://github.com/rafaelsales/whenever-test

@jywarren
Copy link
Member

jywarren commented May 10, 2018 via email

@namangupta01
Copy link
Member Author

I think we should merge this.. so that i can make a follow up pr for cron job discussed above based on this pr. Merging this pr won't affect anything as of now because there is currently no job. :)

@jywarren
Copy link
Member

jywarren commented May 10, 2018 via email

@jywarren jywarren merged commit 5f649b8 into master May 10, 2018
SrinandanPai pushed a commit to SrinandanPai/plots2 that referenced this pull request May 5, 2019
…lab#2706)

* Added whenever gem for easily writing and deploying cron jobs

* Add cron for whenever gem
@emilyashley emilyashley deleted the whenever_gem branch January 15, 2020 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants