From 7a7b62725958d32be04ea1d2a374dc0ef49f839d Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sat, 25 Aug 2018 09:33:38 -0500 Subject: [PATCH] use config for some timers --- onionr/communicator2.py | 4 ++-- onionr/static-data/default_config.json | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/onionr/communicator2.py b/onionr/communicator2.py index df428c03..1c8329da 100755 --- a/onionr/communicator2.py +++ b/onionr/communicator2.py @@ -86,8 +86,8 @@ class OnionrCommunicatorDaemon: OnionrCommunicatorTimers(self, self.daemonCommands, 5) OnionrCommunicatorTimers(self, self.detectAPICrash, 5) peerPoolTimer = OnionrCommunicatorTimers(self, self.getOnlinePeers, 60) - OnionrCommunicatorTimers(self, self.lookupBlocks, 7, requiresPeer=True, maxThreads=1) - OnionrCommunicatorTimers(self, self.getBlocks, 10, requiresPeer=True) + OnionrCommunicatorTimers(self, self.lookupBlocks, self._core.config.get('timers.lookupBlocks'), requiresPeer=True, maxThreads=1) + OnionrCommunicatorTimers(self, self.getBlocks, self._core.config.get('timers.getBlocks'), requiresPeer=True) OnionrCommunicatorTimers(self, self.clearOfflinePeer, 58) OnionrCommunicatorTimers(self, self.daemonTools.cleanOldBlocks, 65) OnionrCommunicatorTimers(self, self.lookupKeys, 60, requiresPeer=True) diff --git a/onionr/static-data/default_config.json b/onionr/static-data/default_config.json index 9fba656b..6e35245e 100644 --- a/onionr/static-data/default_config.json +++ b/onionr/static-data/default_config.json @@ -60,5 +60,9 @@ "minimumScore": -100, "maxStoredPeers": 5000, "maxConnect": 5 + }, + "timers":{ + "lookupBlocks": 25, + "getBlocks": 30 } }