Forum OpenACS Development: Upgrade mode

Collapse
Posted by Andrew Grumet on

This probably belongs in core, but for the moment, here's a modification to ad_schedule_proc that's come in handy during upgrades when I need the server to be alive in order to run APM, but want to minimize background activity that could touch the database or send mail.

Add this code after the clustering check:

+    # we don't schedule a proc if the server is running in upgrade mode.
+    set upgrade_mode_p [ns_config ns/server/[ns_info server]/acs/acs-rollout-support UpgradeModeP]
+    if { ![empty_string_p $upgrade_mode_p] && $upgrade_mode_p } {
+        ns_log Notice "ad_schedule_proc: Running in upgrade mode, not scheduling $proc"
+        return
+    }
+
...and set this parameter in the config file
ns_section ns/server/${server}/acs/acs-rollout-support
ns_param UpgradeModeP 1