From 030244758842657f211b1f7f12416505a94bd043 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Tue, 22 Jan 2019 14:15:02 -0600 Subject: [PATCH] keyerror bugfix and increased api timeout --- onionr/api.py | 2 +- onionr/communicator2.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/onionr/api.py b/onionr/api.py index 3a340dc3..b0a6c8b6 100755 --- a/onionr/api.py +++ b/onionr/api.py @@ -30,7 +30,7 @@ import onionrutils, onionrexceptions, onionrcrypto, blockimporter, onionrevents class FDSafeHandler(WSGIHandler): def handle(self): - timeout = Timeout(10, exception=Exception) + timeout = Timeout(60, exception=Exception) timeout.start() #timeout = gevent.Timeout.start_new(3) diff --git a/onionr/communicator2.py b/onionr/communicator2.py index bda9e29a..81e73f29 100755 --- a/onionr/communicator2.py +++ b/onionr/communicator2.py @@ -244,7 +244,10 @@ class OnionrCommunicatorDaemon: continue if blockHash in self._core.getBlockList(): logger.debug('Block %s is already saved.' % (blockHash,)) - del self.blockQueue[blockHash] + try: + del self.blockQueue[blockHash] + except KeyError: + pass continue if self._core._blacklist.inBlacklist(blockHash): continue