forked from MirrorHub/synapse
Call startup commands as system triggers.
This helps ensures that we only consider ourselves "up" once all the startup functions have completed.
This commit is contained in:
parent
79f689e6c2
commit
80cfad233e
11 changed files with 29 additions and 11 deletions
|
@ -168,7 +168,9 @@ def start(config_options):
|
||||||
)
|
)
|
||||||
|
|
||||||
ps.setup()
|
ps.setup()
|
||||||
reactor.callWhenRunning(_base.start, ps, config.worker_listeners)
|
reactor.addSystemEventTrigger(
|
||||||
|
"before", "startup", _base.start, ps, config.worker_listeners
|
||||||
|
)
|
||||||
|
|
||||||
_base.start_worker_reactor("synapse-appservice", config)
|
_base.start_worker_reactor("synapse-appservice", config)
|
||||||
|
|
||||||
|
|
|
@ -194,7 +194,9 @@ def start(config_options):
|
||||||
)
|
)
|
||||||
|
|
||||||
ss.setup()
|
ss.setup()
|
||||||
reactor.callWhenRunning(_base.start, ss, config.worker_listeners)
|
reactor.addSystemEventTrigger(
|
||||||
|
"before", "startup", _base.start, ss, config.worker_listeners
|
||||||
|
)
|
||||||
|
|
||||||
_base.start_worker_reactor("synapse-client-reader", config)
|
_base.start_worker_reactor("synapse-client-reader", config)
|
||||||
|
|
||||||
|
|
|
@ -193,7 +193,9 @@ def start(config_options):
|
||||||
)
|
)
|
||||||
|
|
||||||
ss.setup()
|
ss.setup()
|
||||||
reactor.callWhenRunning(_base.start, ss, config.worker_listeners)
|
reactor.addSystemEventTrigger(
|
||||||
|
"before", "startup", _base.start, ss, config.worker_listeners
|
||||||
|
)
|
||||||
|
|
||||||
_base.start_worker_reactor("synapse-event-creator", config)
|
_base.start_worker_reactor("synapse-event-creator", config)
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,9 @@ def start(config_options):
|
||||||
)
|
)
|
||||||
|
|
||||||
ss.setup()
|
ss.setup()
|
||||||
reactor.callWhenRunning(_base.start, ss, config.worker_listeners)
|
reactor.addSystemEventTrigger(
|
||||||
|
"before", "startup", _base.start, ss, config.worker_listeners
|
||||||
|
)
|
||||||
|
|
||||||
_base.start_worker_reactor("synapse-federation-reader", config)
|
_base.start_worker_reactor("synapse-federation-reader", config)
|
||||||
|
|
||||||
|
|
|
@ -198,7 +198,9 @@ def start(config_options):
|
||||||
)
|
)
|
||||||
|
|
||||||
ss.setup()
|
ss.setup()
|
||||||
reactor.callWhenRunning(_base.start, ss, config.worker_listeners)
|
reactor.addSystemEventTrigger(
|
||||||
|
"before", "startup", _base.start, ss, config.worker_listeners
|
||||||
|
)
|
||||||
|
|
||||||
_base.start_worker_reactor("synapse-federation-sender", config)
|
_base.start_worker_reactor("synapse-federation-sender", config)
|
||||||
|
|
||||||
|
|
|
@ -247,7 +247,9 @@ def start(config_options):
|
||||||
)
|
)
|
||||||
|
|
||||||
ss.setup()
|
ss.setup()
|
||||||
reactor.callWhenRunning(_base.start, ss, config.worker_listeners)
|
reactor.addSystemEventTrigger(
|
||||||
|
"before", "startup", _base.start, ss, config.worker_listeners
|
||||||
|
)
|
||||||
|
|
||||||
_base.start_worker_reactor("synapse-frontend-proxy", config)
|
_base.start_worker_reactor("synapse-frontend-proxy", config)
|
||||||
|
|
||||||
|
|
|
@ -447,7 +447,7 @@ def setup(config_options):
|
||||||
reactor.stop()
|
reactor.stop()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
reactor.callWhenRunning(start)
|
reactor.addSystemEventTrigger("before", "startup", start)
|
||||||
|
|
||||||
return hs
|
return hs
|
||||||
|
|
||||||
|
|
|
@ -161,7 +161,9 @@ def start(config_options):
|
||||||
)
|
)
|
||||||
|
|
||||||
ss.setup()
|
ss.setup()
|
||||||
reactor.callWhenRunning(_base.start, ss, config.worker_listeners)
|
reactor.addSystemEventTrigger(
|
||||||
|
"before", "startup", _base.start, ss, config.worker_listeners
|
||||||
|
)
|
||||||
|
|
||||||
_base.start_worker_reactor("synapse-media-repository", config)
|
_base.start_worker_reactor("synapse-media-repository", config)
|
||||||
|
|
||||||
|
|
|
@ -216,7 +216,7 @@ def start(config_options):
|
||||||
_base.start(ps, config.worker_listeners)
|
_base.start(ps, config.worker_listeners)
|
||||||
ps.get_pusherpool().start()
|
ps.get_pusherpool().start()
|
||||||
|
|
||||||
reactor.callWhenRunning(start)
|
reactor.addSystemEventTrigger("before", "startup", start)
|
||||||
|
|
||||||
_base.start_worker_reactor("synapse-pusher", config)
|
_base.start_worker_reactor("synapse-pusher", config)
|
||||||
|
|
||||||
|
|
|
@ -451,7 +451,9 @@ def start(config_options):
|
||||||
)
|
)
|
||||||
|
|
||||||
ss.setup()
|
ss.setup()
|
||||||
reactor.callWhenRunning(_base.start, ss, config.worker_listeners)
|
reactor.addSystemEventTrigger(
|
||||||
|
"before", "startup", _base.start, ss, config.worker_listeners
|
||||||
|
)
|
||||||
|
|
||||||
_base.start_worker_reactor("synapse-synchrotron", config)
|
_base.start_worker_reactor("synapse-synchrotron", config)
|
||||||
|
|
||||||
|
|
|
@ -224,7 +224,9 @@ def start(config_options):
|
||||||
)
|
)
|
||||||
|
|
||||||
ss.setup()
|
ss.setup()
|
||||||
reactor.callWhenRunning(_base.start, ss, config.worker_listeners)
|
reactor.addSystemEventTrigger(
|
||||||
|
"before", "startup", _base.start, ss, config.worker_listeners
|
||||||
|
)
|
||||||
|
|
||||||
_base.start_worker_reactor("synapse-user-dir", config)
|
_base.start_worker_reactor("synapse-user-dir", config)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue