Fix uncaught error when shutting down after a failed daemon startup
This commit is contained in:
parent
f1f543ee77
commit
a12c0be0b9
4 changed files with 4 additions and 4 deletions
|
@ -19,7 +19,7 @@ at anytime.
|
||||||
*
|
*
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
*
|
* Fixed uncaught error when shutting down after a failed daemon startup
|
||||||
*
|
*
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
|
@ -488,7 +488,8 @@ class Daemon(AuthJSONRPCServer):
|
||||||
old_revision = int(open(self.db_revision_file).read().strip())
|
old_revision = int(open(self.db_revision_file).read().strip())
|
||||||
|
|
||||||
if old_revision > self.current_db_revision:
|
if old_revision > self.current_db_revision:
|
||||||
raise Exception('This version of lbrynet is not compatible with the database')
|
raise Exception('This version of lbrynet is not compatible with the database\n'
|
||||||
|
'Your database is revision %i, expected %i' % (old_revision, self.current_db_revision))
|
||||||
|
|
||||||
def update_version_file_and_print_success():
|
def update_version_file_and_print_success():
|
||||||
self._write_db_revision_file(self.current_db_revision)
|
self._write_db_revision_file(self.current_db_revision)
|
||||||
|
|
|
@ -97,7 +97,7 @@ def start_server_and_listen(use_auth, analytics_manager):
|
||||||
yield daemon_server.start(use_auth)
|
yield daemon_server.start(use_auth)
|
||||||
analytics_manager.send_server_startup_success()
|
analytics_manager.send_server_startup_success()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.exception('Failed to start')
|
log.exception('Failed to start lbrynet-daemon')
|
||||||
analytics_manager.send_server_startup_error(str(e))
|
analytics_manager.send_server_startup_error(str(e))
|
||||||
daemon_server.stop()
|
daemon_server.stop()
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,6 @@ class DaemonServer(object):
|
||||||
yield self._setup_server(use_auth)
|
yield self._setup_server(use_auth)
|
||||||
yield self._daemon.setup()
|
yield self._daemon.setup()
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
if reactor.running:
|
if reactor.running:
|
||||||
log.info("Stopping the reactor")
|
log.info("Stopping the reactor")
|
||||||
|
|
Loading…
Add table
Reference in a new issue