forked from LBRYCommunity/lbry-sdk
Merge pull request #226 from lbryio/start-tcp-earlier
Start listening before launching browser
This commit is contained in:
commit
96104e65ed
1 changed files with 2 additions and 0 deletions
|
@ -136,10 +136,12 @@ def start_server_and_listen(launchui, use_auth, **kwargs):
|
||||||
lbry = DaemonServer()
|
lbry = DaemonServer()
|
||||||
|
|
||||||
d = lbry.start(**kwargs)
|
d = lbry.start(**kwargs)
|
||||||
|
d.addCallback(lambda _: listen(lbry, use_auth))
|
||||||
if launchui:
|
if launchui:
|
||||||
d.addCallback(lambda _: webbrowser.open(settings.UI_ADDRESS))
|
d.addCallback(lambda _: webbrowser.open(settings.UI_ADDRESS))
|
||||||
d.addErrback(log_and_kill)
|
d.addErrback(log_and_kill)
|
||||||
|
|
||||||
|
def listen(lbry, use_auth):
|
||||||
site_base = get_site_base(use_auth, lbry.root)
|
site_base = get_site_base(use_auth, lbry.root)
|
||||||
lbrynet_server = server.Site(site_base)
|
lbrynet_server = server.Site(site_base)
|
||||||
lbrynet_server.requestFactory = DaemonRequest
|
lbrynet_server.requestFactory = DaemonRequest
|
||||||
|
|
Loading…
Add table
Reference in a new issue