Merge branch 'no_dup_log' into develop

This commit is contained in:
Neil Booth 2016-10-10 11:51:10 +09:00
commit 1a8ca9f2c2

View File

@ -75,13 +75,16 @@ class BlockCache(object):
.format(self.cache_limit))
last_log = 0
prior_height = self.db.height
while await self.maybe_prefill():
now = time.time()
if now > last_log + 15:
count = self.fetched_height - prior_height
if now > last_log + 15 and count:
last_log = now
self.logger.info('prefilled blocks to height {:,d} '
prior_height = self.fetched_height
self.logger.info('prefilled {:,d} blocks to height {:,d} '
'daemon height: {:,d}'
.format(self.fetched_height,
.format(count, self.fetched_height,
self.daemon_height))
await asyncio.sleep(1)