diff --git a/lbry/wallet/server/block_processor.py b/lbry/wallet/server/block_processor.py index e2ecb69ce..eceb62e08 100644 --- a/lbry/wallet/server/block_processor.py +++ b/lbry/wallet/server/block_processor.py @@ -351,11 +351,9 @@ class BlockProcessor: # performed on the DB. if self._caught_up_event.is_set(): await self.flush(True) - elif time.time() > self.next_cache_check: - flush_arg = self.check_cache_size() - if flush_arg is not None: - await self.flush(flush_arg) - self.next_cache_check = time.time() + 30 + elif time.perf_counter() > self.next_cache_check: + await self.flush(True) + self.next_cache_check = time.perf_counter() + 30 def check_cache_size(self): """Flush a cache if it gets too big."""