Skip to content

Instantly share code, notes, and snippets.

@jhubert
Last active March 29, 2017 03:54
Show Gist options
  • Save jhubert/8c0f6cde3e13bfd2ab8478c5c5fd7379 to your computer and use it in GitHub Desktop.
Save jhubert/8c0f6cde3e13bfd2ab8478c5c5fd7379 to your computer and use it in GitHub Desktop.
There is a small period of time when migrations aren't recognized by rails during the deploy process and this causes errors.
- old code is running
- new code hits heroku
- heroku restart -> loads up the new code. takes 3ish minutes
- migration happens
- heroku restart -> loads up the new code again. takes 3ish minutes
With Preboot:
[old code ----------------------------------------------------]
[new code ----------------------------------------------][********]
[new db ------------------------------------------------------]
[new code ------------------------------------------------]
Without Preboot:
[------no response---]
[old code]
[new cod|
[new db]
[new code----]
I think the ideal situation would be that the first restart is skipped so that the rails app continues to hold on to it's existing db connection until the migration is done, and then the restart is fired.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment