Improve daemon stopping error handling
This commit is contained in:
parent
cfb1986ad0
commit
0a7c3aeaab
@ -220,7 +220,7 @@ def error(data, error=None, timestamp=True):
|
||||
if get_level() <= LEVEL_ERROR:
|
||||
log('-', data, colors.fg.red, timestamp=timestamp)
|
||||
if not error is None:
|
||||
debug('Error details: ' + str(error) + parse_error())
|
||||
debug('Error: ' + str(error) + parse_error())
|
||||
|
||||
# fatal: when the something so bad has happened that the prorgam must stop
|
||||
def fatal(data, timestamp=True):
|
||||
|
@ -527,7 +527,8 @@ class Onionr:
|
||||
Shutdown the Onionr daemon
|
||||
'''
|
||||
|
||||
logger.warn('Killing the running daemon')
|
||||
logger.warn('Killing the running daemon...', timestamp = False)
|
||||
try:
|
||||
events.event('daemon_stop', onionr = self)
|
||||
net = NetController(config.get('client')['port'])
|
||||
try:
|
||||
@ -536,6 +537,8 @@ class Onionr:
|
||||
pass
|
||||
self.onionrCore.daemonQueueAdd('shutdown')
|
||||
net.killTor()
|
||||
except Exception as e:
|
||||
logger.error('Failed to shutdown daemon.', error = e, timestamp = False)
|
||||
|
||||
return
|
||||
|
||||
@ -543,6 +546,7 @@ class Onionr:
|
||||
'''
|
||||
Displays statistics and exits
|
||||
'''
|
||||
|
||||
logger.info('Our pubkey: ' + self.onionrCore._crypto.pubKey)
|
||||
logger.info('Our address: ' + self.get_hostname())
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user