Commit 73ae82c4 authored by echel0n's avatar echel0n
Browse files

fix startup issue

fix config migration
parent 9910aad4
...@@ -484,6 +484,9 @@ def start(): ...@@ -484,6 +484,9 @@ def start():
app.pid = app.daemon.pid app.pid = app.daemon.pid
app.start() app.start()
from tornado.ioloop import IOLoop
IOLoop.current().start()
except (SystemExit, KeyboardInterrupt): except (SystemExit, KeyboardInterrupt):
if app: if app:
app.shutdown() app.shutdown()
......
...@@ -1131,8 +1131,7 @@ class Config(object): ...@@ -1131,8 +1131,7 @@ class Config(object):
self.nmjv2.enable = self._get_config_file_value(config_object, 'NMJv2', 'use_nmjv2', default=self.nmjv2.enable, field_type=bool) self.nmjv2.enable = self._get_config_file_value(config_object, 'NMJv2', 'use_nmjv2', default=self.nmjv2.enable, field_type=bool)
self.nmjv2.host = self._get_config_file_value(config_object, 'NMJv2', 'nmjv2_host', default=self.nmjv2.host, field_type=str) self.nmjv2.host = self._get_config_file_value(config_object, 'NMJv2', 'nmjv2_host', default=self.nmjv2.host, field_type=str)
self.nmjv2.database = self._get_config_file_value(config_object, 'NMJv2', 'nmjv2_database', default=self.nmjv2.database, field_type=str) self.nmjv2.database = self._get_config_file_value(config_object, 'NMJv2', 'nmjv2_database', default=self.nmjv2.database, field_type=str)
self.nmjv2.db_loc = NMJv2Location[ self.nmjv2.db_loc = NMJv2Location[self._get_config_file_value(config_object, 'NMJv2', 'nmjv2_dbloc', default=NMJv2Location.LOCAL.name, field_type=str.upper)]
self._get_config_file_value(config_object, 'NMJv2', 'nmjv2_dbloc', default=NMJv2Location.LOCAL.name, field_type=str.upper)]
# SYNOLOGY SETTINGS # SYNOLOGY SETTINGS
self.synology.host = self._get_config_file_value(config_object, 'SynologyDSM', 'syno_dsm_host', default=self.synology.host, field_type=str) self.synology.host = self._get_config_file_value(config_object, 'SynologyDSM', 'syno_dsm_host', default=self.synology.host, field_type=str)
...@@ -1424,9 +1423,7 @@ class Config(object): ...@@ -1424,9 +1423,7 @@ class Config(object):
if key in section_object: if key in section_object:
try: try:
value = self.convert_value(section_object.get(key), field_type) value = self.convert_value(section_object.get(key), field_type)
if value is None: return value or default
return default
return value
except Exception: except Exception:
return default return default
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment