summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2016-04-26 15:57:28 +0100
committerMark Haines <mark.haines@matrix.org>2016-04-26 15:57:28 +0100
commitb80b93ea0f47f9854bc093c72f4f0bd42898fabe (patch)
tree3de9e80621e53929e063d9f63d43f0e43b9a5617
parentOptionally daemonize the pusher (diff)
downloadsynapse-b80b93ea0f47f9854bc093c72f4f0bd42898fabe.tar.xz
Add a log context to the daemonized pusher
-rw-r--r--synapse/app/pusher.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/app/pusher.py b/synapse/app/pusher.py
index 5f3200cf4c..a67650b5d1 100644
--- a/synapse/app/pusher.py
+++ b/synapse/app/pusher.py
@@ -296,10 +296,15 @@ if __name__ == '__main__':
         ps = setup(sys.argv[1:])
 
         if ps.config.daemonize:
+            def run():
+                with LoggingContext("run"):
+                    change_resource_limit(ps.config.soft_file_limit)
+                    reactor.run()
+
             daemon = Daemonize(
                 app="synapse-pusher",
                 pid=ps.config.pid_file,
-                action=reactor.run,
+                action=run,
                 auto_close_fds=False,
                 verbose=True,
                 logger=logger,