Changeset View
Changeset View
Standalone View
Standalone View
wallace/__init__.py
Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | |||||
def worker_process(*args, **kw): | def worker_process(*args, **kw): | ||||
log.debug(_("Worker process %s initializing") % (multiprocessing.current_process().name), level=1) | log.debug(_("Worker process %s initializing") % (multiprocessing.current_process().name), level=1) | ||||
class WallaceDaemon(object): | class WallaceDaemon(object): | ||||
def __init__(self): | def __init__(self): | ||||
self.current_connections = 0 | self.current_connections = 0 | ||||
self.max_connections = 24 | self.max_connections = 24 | ||||
self.pool = None | |||||
daemon_group = conf.add_cli_parser_option_group(_("Daemon Options")) | daemon_group = conf.add_cli_parser_option_group(_("Daemon Options")) | ||||
daemon_group.add_option( | daemon_group.add_option( | ||||
"--fork", | "--fork", | ||||
dest = "fork_mode", | dest = "fork_mode", | ||||
action = "store_true", | action = "store_true", | ||||
default = False, | default = False, | ||||
▲ Show 20 Lines • Show All 216 Lines • ▼ Show 20 Lines | class WallaceDaemon(object): | ||||
def reload_config(self, *args, **kw): | def reload_config(self, *args, **kw): | ||||
pass | pass | ||||
def remove_pid(self, *args, **kw): | def remove_pid(self, *args, **kw): | ||||
if os.access(conf.pidfile, os.R_OK): | if os.access(conf.pidfile, os.R_OK): | ||||
os.remove(conf.pidfile) | os.remove(conf.pidfile) | ||||
if self.pool is not None: | |||||
self.pool.close() | self.pool.close() | ||||
self.pool.join() | self.pool.join() | ||||
raise SystemExit | raise SystemExit | ||||
def run(self): | def run(self): | ||||
""" | """ | ||||
Run the Wallace daemon. | Run the Wallace daemon. | ||||
""" | """ | ||||
▲ Show 20 Lines • Show All 145 Lines • Show Last 20 Lines |