Created
January 21, 2014 13:23
-
-
Save mezis/8539934 to your computer and use it in GitHub Desktop.
Restart servers in a staggered manner.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git i/config/deploy.rb w/config/deploy.rb | |
index 73fc910..594322c 100644 | |
--- i/config/deploy.rb | |
+++ w/config/deploy.rb | |
@@ -65,7 +65,7 @@ end | |
desc 'restart' | |
deploy.task :restart, :roles => :web do | |
- run "touch #{current_path}/tmp/restart.txt" | |
+ run "bash -c 'sleep $(( $RANDOM / 100 ))' ; date ; touch #{current_path}/tmp/restart.txt" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why broken? They're just restarted with a new version of the code which is fine. The only issue is that for 5 minutes users may get 1 page from the old code and 1 page from the new