GSA-TTS/all_sorns

App not updating nightly

Closed this issue · 4 comments

Our app isn't updating nightly like it should be.

We have a command run in the middle of the night to look for new SORNs. Yet, our worker isn't awake then. We need to define a worker process to be waiting to do do work.

https://docs.cloudfoundry.org/devguide/deploy-apps/manifest-attributes.html#-processes

We had been starting GoodJob (our worker) by hand. It gets stopped whenever there is a deploy though (I assume).

On Heroku, this would double the monthly bill. I don't know how Cloud.gov charges.

I started GoodJob by hand yesterday on production. It still didn't get any new SORNs last night.

we could use github actions to do a nightly redeploy and then just have it run find-sorns then

Ah, I see. Cloud.gov doesn't let us use their cron to run tasks. https://cloud.gov/docs/management/one-off-tasks/

Run periodic scheduled tasks
If you’d like to run a periodic scheduled task (similar to a cron job), you should find a cron-like library in the programming language that you’re working with, and implement the task using that library. You may run this as part of an existing application or as a separate application.
If you use continuous deployment, you can use a timer as an input to a task or pipeline that runs a Cloud Foundry Task. You can see a demonstration of this approach using the Travis CI/CD platform here. Note - this same approach can be easily adapted to other common CI/CD platforms like Jenkins, CircleCI and GitHub Actions.

We should remove the crontab and whenever gem that we were trying.

Laura had some ideas I wanted to write down so we don't forget:

  • Use a Github Action to run find_sorns everynight.
  • Schedule a repeating GoodJob to run find_sorns everynight. Reading about this though, it can be a little fragile. Our job is simple enough though, that I still think it is a valid approach.