mirror of https://github.com/zulip/zulip.git
Log a statsd event when restarting the server
(imported from commit e9fa632a39f0a6b6aa7311e80e68faf4178a2cf3)
This commit is contained in:
parent
29ad205b01
commit
d02f46fba7
|
@ -5,6 +5,7 @@ import subprocess
|
||||||
import pylibmc
|
import pylibmc
|
||||||
import traceback
|
import traceback
|
||||||
import logging
|
import logging
|
||||||
|
import time
|
||||||
|
|
||||||
logging.basicConfig(format="%(asctime)s restart-server: %(message)s",
|
logging.basicConfig(format="%(asctime)s restart-server: %(message)s",
|
||||||
level=logging.INFO)
|
level=logging.INFO)
|
||||||
|
@ -18,6 +19,9 @@ ENDC = '\033[0m'
|
||||||
|
|
||||||
os.chdir("/home/humbug/humbug-deployments/current")
|
os.chdir("/home/humbug/humbug-deployments/current")
|
||||||
|
|
||||||
|
# Send a statsd event on restarting the server
|
||||||
|
subprocess.check_call(["python", "./manage.py", "send_stats", "gauge", "events.server_restart", str(int(time.time()))])
|
||||||
|
|
||||||
# Restart the FastCGI process, which is running in a shell loop in screen.
|
# Restart the FastCGI process, which is running in a shell loop in screen.
|
||||||
# TODO: real daemonization
|
# TODO: real daemonization
|
||||||
logging.info("Killing daemons")
|
logging.info("Killing daemons")
|
||||||
|
|
Loading…
Reference in New Issue