forked from LBRYCommunity/lbry-sdk
remove null handling used to fix a now resolved bug, update daemon_status outputs per alex's suggestions
This commit is contained in:
parent
8b966c61d8
commit
6b9f1d519e
1 changed files with 5 additions and 8 deletions
|
@ -229,7 +229,7 @@ class LBRYDaemon(jsonrpc.JSONRPC):
|
||||||
else:
|
else:
|
||||||
request.setHeader("Access-Control-Allow-Origin", "*")
|
request.setHeader("Access-Control-Allow-Origin", "*")
|
||||||
request.setHeader("content-type", "text/json")
|
request.setHeader("content-type", "text/json")
|
||||||
if args == [{}] or args == [None]:
|
if args == [{}]:
|
||||||
d = defer.maybeDeferred(function)
|
d = defer.maybeDeferred(function)
|
||||||
else:
|
else:
|
||||||
d = defer.maybeDeferred(function, *args)
|
d = defer.maybeDeferred(function, *args)
|
||||||
|
@ -928,13 +928,10 @@ class LBRYDaemon(jsonrpc.JSONRPC):
|
||||||
if status_code is 'loading_wallet', also contains key 'progress': blockchain catchup progress
|
if status_code is 'loading_wallet', also contains key 'progress': blockchain catchup progress
|
||||||
"""
|
"""
|
||||||
|
|
||||||
r = {'status_code': self.startup_status[0], 'status_message': self.startup_status[1]}
|
r = {'code': self.startup_status[0], 'message': self.startup_status[1], 'progress': None}
|
||||||
try:
|
|
||||||
if self.startup_status[0] == 'loading_wallet':
|
if self.startup_status[0] == 'loading_wallet':
|
||||||
r['status_message'] = r['status_message'] % (str(self.session.wallet.blocks_behind_alert) + " blocks behind")
|
r['message'] = r['message'] % (str(self.session.wallet.blocks_behind_alert) + " blocks behind")
|
||||||
r['progress'] = self.session.wallet.catchup_progress
|
r['progress'] = self.session.wallet.catchup_progress
|
||||||
except:
|
|
||||||
pass
|
|
||||||
log.info("[" + str(datetime.now()) + "] daemon status: " + str(r))
|
log.info("[" + str(datetime.now()) + "] daemon status: " + str(r))
|
||||||
return self._render_response(r, OK_CODE)
|
return self._render_response(r, OK_CODE)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue