From 3b6006d759c082597360eb49a4d92ead8e457222 Mon Sep 17 00:00:00 2001 From: Job Evers-Meltzer Date: Mon, 31 Oct 2016 14:00:07 -0500 Subject: [PATCH] Start listening before launching browser --- lbrynet/lbrynet_daemon/DaemonControl.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lbrynet/lbrynet_daemon/DaemonControl.py b/lbrynet/lbrynet_daemon/DaemonControl.py index 74fd6831f..d432e45d3 100644 --- a/lbrynet/lbrynet_daemon/DaemonControl.py +++ b/lbrynet/lbrynet_daemon/DaemonControl.py @@ -136,10 +136,12 @@ def start_server_and_listen(launchui, use_auth, **kwargs): lbry = DaemonServer() d = lbry.start(**kwargs) + d.addCallback(lambda _: listen(lbry, use_auth)) if launchui: d.addCallback(lambda _: webbrowser.open(settings.UI_ADDRESS)) d.addErrback(log_and_kill) +def listen(lbry, use_auth): site_base = get_site_base(use_auth, lbry.root) lbrynet_server = server.Site(site_base) lbrynet_server.requestFactory = DaemonRequest