[or-cvs] r12891: Add more logging on sighup. move all load code into reload() (in bridgedb/trunk: . lib/bridgedb)
nickm at seul.org
nickm at seul.org
Fri Dec 21 04:51:31 UTC 2007
Author: nickm
Date: 2007-12-20 23:51:31 -0500 (Thu, 20 Dec 2007)
New Revision: 12891
Modified:
bridgedb/trunk/
bridgedb/trunk/lib/bridgedb/Main.py
Log:
r17296 at catbus: nickm | 2007-12-20 23:51:29 -0500
Add more logging on sighup. move all load code into reload() function; just call reload() on first load.
Property changes on: bridgedb/trunk
___________________________________________________________________
svk:merge ticket from /bridgedb/trunk [r17296] on 8246c3cf-6607-4228-993b-4d95d33730f1
Modified: bridgedb/trunk/lib/bridgedb/Main.py
===================================================================
--- bridgedb/trunk/lib/bridgedb/Main.py 2007-12-21 04:23:48 UTC (rev 12890)
+++ bridgedb/trunk/lib/bridgedb/Main.py 2007-12-21 04:51:31 UTC (rev 12891)
@@ -114,6 +114,7 @@
"""Read all the bridge files from cfg, and pass them into a splitter
object.
"""
+ logging.info("Loading bridges")
status = {}
if cfg.STATUS_FILE:
f = open(cfg.STATUS_FILE, 'r')
@@ -204,17 +205,24 @@
Bridges.PrefixStore(store, "ls|"))
splitter.addTracker(stats)
- # Parse the bridges and log how many we put where.
- logging.info("Loading bridges")
- load(cfg, splitter)
- logging.info("%d bridges loaded", len(splitter))
- if emailDistributor:
- logging.info("%d for email", len(emailDistributor.ring))
- if ipDistributor:
- logging.info("%d for web:", len(ipDistributor.splitter))
- logging.info(" by location set: %s",
- " ".join(str(len(r)) for r in ipDistributor.rings))
+ # Make the parse-bridges function get re-called on SIGHUP.
+ def reload():
+ logging.info("Caught SIGHUP")
+ load(cfg, splitter)
+ logging.info("%d bridges loaded", len(splitter))
+ if emailDistributor:
+ logging.info("%d for email", len(emailDistributor.ring))
+ if ipDistributor:
+ logging.info("%d for web:", len(ipDistributor.splitter))
+ logging.info(" by location set: %s",
+ " ".join(str(len(r)) for r in ipDistributor.rings))
+ global _reloadFn
+ _reloadFn = reload
+ signal.signal(signal.SIGHUP, _handleSIGHUP)
+ # And actually load it to start.
+ reload()
+
# Configure HTTP and/or HTTPS servers.
if cfg.HTTPS_DIST and cfg.HTTPS_SHARE:
Server.addWebServer(cfg, ipDistributor, webSchedule)
@@ -223,14 +231,6 @@
if cfg.EMAIL_DIST and cfg.EMAIL_SHARE:
Server.addSMTPServer(cfg, emailDistributor, emailSchedule)
- # Make the parse-bridges function get re-called on SIGHUP.
- def reload():
- logging.info("Caught SIGHUP")
- load(cfg, splitter)
- global _reloadFn
- _reloadFn = reload
- signal.signal(signal.SIGHUP, _handleSIGHUP)
-
# Actually run the servers.
try:
logging.info("Starting reactors.")
More information about the tor-commits
mailing list