Merge branch 'fix-allowed-during-startup'

This commit is contained in:
Jack Robison 2017-07-19 12:09:52 -04:00
commit ac2602e8b3
No known key found for this signature in database
GPG key ID: 284699E7404E3CFF
4 changed files with 9 additions and 5 deletions

View file

@ -25,6 +25,7 @@ at anytime.
* Fixed daemon process hanging when started without an internet connection
* Fixed https://github.com/lbryio/lbry/issues/774
* Fix XDG compliance on Linux
* Fixed https://github.com/lbryio/lbry/issues/760
### Deprecated
*

View file

@ -165,11 +165,12 @@ class Daemon(AuthJSONRPCServer):
LBRYnet daemon, a jsonrpc interface to lbry functions
"""
allowed_during_startup = [
'daemon_stop', 'status', 'version',
]
def __init__(self, root, analytics_manager):
AuthJSONRPCServer.__init__(self, conf.settings['use_auth_http'])
self.allowed_during_startup = [
'stop', 'status', 'version',
]
self.db_dir = conf.settings['data_dir']
self.download_directory = conf.settings['download_directory']
if conf.settings['BLOBFILES_DIR'] == "blobfiles":

View file

@ -82,7 +82,9 @@ def main():
suggest_help=False)
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."
message = status['startup_status']['message']
if message:

View file

@ -192,6 +192,7 @@ class AuthJSONRPCServer(AuthorizedBase):
implements(resource.IResource)
isLeaf = True
allowed_during_startup = []
def __init__(self, use_authentication=None):
self._call_lock = {}
@ -199,7 +200,6 @@ class AuthJSONRPCServer(AuthorizedBase):
use_authentication if use_authentication is not None else conf.settings['use_auth_http']
)
self.announced_startup = False
self.allowed_during_startup = []
self.sessions = {}
def setup(self):