noosfero | 2 new commits pushed to repository
Leandro Nunes
gitlab at gitlab.com
Tue Jan 20 16:26:56 BRST 2015
Leandro Nunes pushed to refs/heads/master at <a href="https://gitlab.com/noosfero/noosfero">Noosfero / noosfero</a>
Commits:
<a href="https://gitlab.com/noosfero/noosfero/commit/585963ae1f48474605aa7f991a63d3a9d16bb1d4">585963ae</a> by Victor Costa
Restart with zero downtime
- - - - -
<a href="https://gitlab.com/noosfero/noosfero/commit/b96e7cf28a318b33e259bf8379284082e08a3da0">b96e7cf2</a> by Leandro Nunes
Merge branch 'restart_zero_downtime' into 'master'
Zero downtime restart
See merge request !361
- - - - -
Changes:
=====================================
etc/init.d/noosfero
=====================================
--- a/etc/init.d/noosfero
+++ b/etc/init.d/noosfero
@@ -115,8 +115,11 @@ do_stop() {
}
do_restart() {
- do_stop
- do_start
+ if running; then
+ main_script restart
+ else
+ do_start
+ fi
}
running(){
=====================================
script/production
=====================================
--- a/script/production
+++ b/script/production
@@ -45,6 +45,16 @@ do_stop() {
stop_via_pid_file tmp/pids/delayed_job.pid tmp/pids/delayed_job.*.pid tmp/pids/feed-updater.*.pid
}
+do_restart() {
+ rake db:migrate SCHEMA=/dev/null
+ environments_loop stop ||
+ stop_via_pid_file tmp/pids/delayed_job.pid tmp/pids/delayed_job.*.pid tmp/pids/feed-updater.*.pid
+ environments_loop start
+
+ clear_cache
+ ruby -S thin -C config/thin.yml restart --onebyone
+}
+
stop_via_pid_file() {
for pidfile in $@; do
if [ -e "$pidfile" ]; then
@@ -84,9 +94,7 @@ case "$ACTION" in
;;
restart)
- do_stop
- sleep 1
- do_start
+ do_restart
;;
*)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150120/73bc4d78/attachment.html>
More information about the Noosfero-dev
mailing list