diff --git a/rhodecode/lib/hooks_daemon.py b/rhodecode/lib/hooks_daemon.py --- a/rhodecode/lib/hooks_daemon.py +++ b/rhodecode/lib/hooks_daemon.py @@ -153,19 +153,20 @@ class HttpHooksCallbackDaemon(ThreadedHo POLL_INTERVAL = 0.01 def _prepare(self, txn_id=None, host=None, port=None): + host = host or '127.0.0.1' self._done = False - self._daemon = TCPServer((host, port or 0), HooksHttpHandler) - _, port = self._daemon.server_address self.hooks_uri = '{}:{}'.format(host, port) self.txn_id = txn_id # inject transaction_id for later verification self._daemon.txn_id = self.txn_id - log.debug( "Preparing HTTP callback daemon at `%s` and registering hook object", self.hooks_uri) + self._daemon = TCPServer((host, port or 0), HooksHttpHandler) + _, port = self._daemon.server_address + def _run(self): log.debug("Running event loop of callback daemon in background thread") callback_thread = threading.Thread(