Merge branch 'fix-allowed-during-startup'
This commit is contained in:
commit
ac2602e8b3
4 changed files with 9 additions and 5 deletions
|
@ -25,6 +25,7 @@ at anytime.
|
||||||
* Fixed daemon process hanging when started without an internet connection
|
* Fixed daemon process hanging when started without an internet connection
|
||||||
* Fixed https://github.com/lbryio/lbry/issues/774
|
* Fixed https://github.com/lbryio/lbry/issues/774
|
||||||
* Fix XDG compliance on Linux
|
* Fix XDG compliance on Linux
|
||||||
|
* Fixed https://github.com/lbryio/lbry/issues/760
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
*
|
*
|
||||||
|
|
|
@ -165,11 +165,12 @@ class Daemon(AuthJSONRPCServer):
|
||||||
LBRYnet daemon, a jsonrpc interface to lbry functions
|
LBRYnet daemon, a jsonrpc interface to lbry functions
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
allowed_during_startup = [
|
||||||
|
'daemon_stop', 'status', 'version',
|
||||||
|
]
|
||||||
|
|
||||||
def __init__(self, root, analytics_manager):
|
def __init__(self, root, analytics_manager):
|
||||||
AuthJSONRPCServer.__init__(self, conf.settings['use_auth_http'])
|
AuthJSONRPCServer.__init__(self, conf.settings['use_auth_http'])
|
||||||
self.allowed_during_startup = [
|
|
||||||
'stop', 'status', 'version',
|
|
||||||
]
|
|
||||||
self.db_dir = conf.settings['data_dir']
|
self.db_dir = conf.settings['data_dir']
|
||||||
self.download_directory = conf.settings['download_directory']
|
self.download_directory = conf.settings['download_directory']
|
||||||
if conf.settings['BLOBFILES_DIR'] == "blobfiles":
|
if conf.settings['BLOBFILES_DIR'] == "blobfiles":
|
||||||
|
|
|
@ -82,7 +82,9 @@ def main():
|
||||||
suggest_help=False)
|
suggest_help=False)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
if status['startup_status']['code'] != "started":
|
status_code = status['startup_status']['code']
|
||||||
|
|
||||||
|
if status_code != "started" and method not in Daemon.allowed_during_startup:
|
||||||
print "Daemon is in the process of starting. Please try again in a bit."
|
print "Daemon is in the process of starting. Please try again in a bit."
|
||||||
message = status['startup_status']['message']
|
message = status['startup_status']['message']
|
||||||
if message:
|
if message:
|
||||||
|
|
|
@ -192,6 +192,7 @@ class AuthJSONRPCServer(AuthorizedBase):
|
||||||
implements(resource.IResource)
|
implements(resource.IResource)
|
||||||
|
|
||||||
isLeaf = True
|
isLeaf = True
|
||||||
|
allowed_during_startup = []
|
||||||
|
|
||||||
def __init__(self, use_authentication=None):
|
def __init__(self, use_authentication=None):
|
||||||
self._call_lock = {}
|
self._call_lock = {}
|
||||||
|
@ -199,7 +200,6 @@ class AuthJSONRPCServer(AuthorizedBase):
|
||||||
use_authentication if use_authentication is not None else conf.settings['use_auth_http']
|
use_authentication if use_authentication is not None else conf.settings['use_auth_http']
|
||||||
)
|
)
|
||||||
self.announced_startup = False
|
self.announced_startup = False
|
||||||
self.allowed_during_startup = []
|
|
||||||
self.sessions = {}
|
self.sessions = {}
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
|
|
Loading…
Reference in a new issue