forked from LBRYCommunity/lbry-sdk
commit
c37bb0d1ed
1 changed files with 8 additions and 12 deletions
|
@ -10,8 +10,8 @@ from jsonrpc.proxy import JSONRPCProxy
|
||||||
from lbrynet import analytics
|
from lbrynet import analytics
|
||||||
from lbrynet import conf
|
from lbrynet import conf
|
||||||
from lbrynet.core import utils
|
from lbrynet.core import utils
|
||||||
|
from lbrynet.lbrynet_daemon.auth import client
|
||||||
from lbrynet.lbrynet_daemon.DaemonServer import DaemonServer
|
from lbrynet.lbrynet_daemon.DaemonServer import DaemonServer
|
||||||
from lbrynet import conf
|
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -22,19 +22,15 @@ def test_internet_connection():
|
||||||
|
|
||||||
|
|
||||||
def stop():
|
def stop():
|
||||||
def _disp_shutdown():
|
conf.initialize_settings()
|
||||||
print "Shutting down lbrynet-daemon from command line"
|
log_support.configure_console()
|
||||||
|
try:
|
||||||
|
client.LBRYAPIClient.config().stop()
|
||||||
|
except Exception:
|
||||||
|
log.exception('Failed to stop deamon')
|
||||||
|
else:
|
||||||
log.info("Shutting down lbrynet-daemon from command line")
|
log.info("Shutting down lbrynet-daemon from command line")
|
||||||
|
|
||||||
def _disp_not_running():
|
|
||||||
print "Attempt to shut down lbrynet-daemon from command line when daemon isn't running"
|
|
||||||
log.info("Attempt to shut down lbrynet-daemon from command line when daemon isn't running")
|
|
||||||
|
|
||||||
d = defer.Deferred(None)
|
|
||||||
d.addCallback(lambda _: JSONRPCProxy.from_url(conf.settings.API_CONNECTION_STRING).stop())
|
|
||||||
d.addCallbacks(lambda _: _disp_shutdown(), lambda _: _disp_not_running())
|
|
||||||
d.callback(None)
|
|
||||||
|
|
||||||
|
|
||||||
def start():
|
def start():
|
||||||
conf.initialize_settings()
|
conf.initialize_settings()
|
||||||
|
|
Loading…
Reference in a new issue