handle keyboardinterrupt better in flow

This commit is contained in:
Kevin Froman 2018-07-12 18:23:58 -05:00
parent 865bc94ccb
commit db203290dd
No known key found for this signature in database
GPG Key ID: 0D414D0FE405B63B

View File

@ -66,7 +66,11 @@ class OnionrFlow:
content = self.myCore._utils.escapeAnsi(content.replace('\n', '\\n').replace('\r', '\\r').strip()) content = self.myCore._utils.escapeAnsi(content.replace('\n', '\\n').replace('\r', '\\r').strip())
logger.info("\n" + block.getDate().strftime("%m/%d %H:%M") + ' - ' + '\033[0;0m' + content) logger.info("\n" + block.getDate().strftime("%m/%d %H:%M") + ' - ' + '\033[0;0m' + content)
self.alreadyOutputed.append(blockHash) self.alreadyOutputed.append(blockHash)
try:
time.sleep(5) time.sleep(5)
except KeyboardInterrupt:
self.flowRunning = False
pass
def on_init(api, data = None): def on_init(api, data = None):
''' '''