forked from LBRYCommunity/lbry-sdk
various fixes
This commit is contained in:
parent
395a68b261
commit
dee0917642
3 changed files with 8 additions and 7 deletions
|
@ -254,6 +254,7 @@ def get_data_dir():
|
||||||
data_dir = user_data_dir("LBRY")
|
data_dir = user_data_dir("LBRY")
|
||||||
if not os.path.isdir(data_dir):
|
if not os.path.isdir(data_dir):
|
||||||
os.mkdir(data_dir)
|
os.mkdir(data_dir)
|
||||||
|
return data_dir
|
||||||
|
|
||||||
|
|
||||||
def get_log_filename():
|
def get_log_filename():
|
||||||
|
|
|
@ -273,7 +273,7 @@ class Daemon(AuthJSONRPCServer):
|
||||||
self.ui_version = None
|
self.ui_version = None
|
||||||
self.ip = None
|
self.ip = None
|
||||||
self.first_run = None
|
self.first_run = None
|
||||||
self.log_file = conf.get_log_file()
|
self.log_file = conf.get_log_filename()
|
||||||
self.current_db_revision = 1
|
self.current_db_revision = 1
|
||||||
self.session = None
|
self.session = None
|
||||||
self.first_run_after_update = False
|
self.first_run_after_update = False
|
||||||
|
@ -282,7 +282,7 @@ class Daemon(AuthJSONRPCServer):
|
||||||
# TODO: this should probably be passed into the daemon, or
|
# TODO: this should probably be passed into the daemon, or
|
||||||
# possibly have the entire log upload functionality taken out
|
# possibly have the entire log upload functionality taken out
|
||||||
# of the daemon, but I don't want to deal with that now
|
# of the daemon, but I don't want to deal with that now
|
||||||
self.log_uploader = log_support.LogUploader.load('lbrynet', conf.get_log_file())
|
self.log_uploader = log_support.LogUploader.load('lbrynet', conf.get_log_filename())
|
||||||
|
|
||||||
self.analytics_manager = None
|
self.analytics_manager = None
|
||||||
self.lbryid = PENDING_LBRY_ID
|
self.lbryid = PENDING_LBRY_ID
|
||||||
|
@ -757,13 +757,13 @@ class Daemon(AuthJSONRPCServer):
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def _set_lbryid(self, lbryid):
|
def _set_lbryid(self, lbryid):
|
||||||
if lbryid is PENDING_LBRY_ID:
|
if lbryid is PENDING_LBRY_ID or lbryid is None:
|
||||||
return self._make_lbryid()
|
return self._make_set_and_save_lbryid()
|
||||||
else:
|
else:
|
||||||
log.info("LBRY ID: " + base58.b58encode(lbryid))
|
log.info("LBRY ID: " + base58.b58encode(lbryid))
|
||||||
self.lbryid = lbryid
|
self.lbryid = lbryid
|
||||||
|
|
||||||
def _make_lbryid(self):
|
def _make_set_and_save_lbryid(self):
|
||||||
self.lbryid = generate_id()
|
self.lbryid = generate_id()
|
||||||
log.info("Generated new LBRY ID: " + base58.b58encode(self.lbryid))
|
log.info("Generated new LBRY ID: " + base58.b58encode(self.lbryid))
|
||||||
d = self.settings.save_lbryid(self.lbryid)
|
d = self.settings.save_lbryid(self.lbryid)
|
||||||
|
|
|
@ -69,7 +69,7 @@ def start():
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
utils.setup_certs_for_windows()
|
utils.setup_certs_for_windows()
|
||||||
lbrynet_log = conf.get_log_file()
|
lbrynet_log = conf.get_log_filename()
|
||||||
log_support.configure_logging(lbrynet_log, args.logtoconsole, args.verbose)
|
log_support.configure_logging(lbrynet_log, args.logtoconsole, args.verbose)
|
||||||
|
|
||||||
to_pass = {}
|
to_pass = {}
|
||||||
|
@ -144,7 +144,7 @@ def start_server_and_listen(launchui, use_auth, **kwargs):
|
||||||
lbrynet_server = server.Site(site_base)
|
lbrynet_server = server.Site(site_base)
|
||||||
lbrynet_server.requestFactory = DaemonRequest
|
lbrynet_server.requestFactory = DaemonRequest
|
||||||
try:
|
try:
|
||||||
reactor.listenTCP(settings.API_PORT, lbrynet_server, interface=settings.API_INTERFACE)
|
reactor.listenTCP(settings.api_port, lbrynet_server, interface=settings.API_INTERFACE)
|
||||||
except error.CannotListenError:
|
except error.CannotListenError:
|
||||||
log.info('Daemon already running, exiting app')
|
log.info('Daemon already running, exiting app')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
Loading…
Add table
Reference in a new issue