Reset the timer as soon as you start processing the batch
This commit is contained in:
parent
6dc86635a4
commit
b777bbcfa8
1 changed files with 1 additions and 1 deletions
|
@ -95,13 +95,13 @@ class AdafruitIoPlugin(Plugin):
|
||||||
|
|
||||||
if data and (last_processed_batch_timestamp is None or
|
if data and (last_processed_batch_timestamp is None or
|
||||||
time.time() - last_processed_batch_timestamp >= self.throttle_seconds):
|
time.time() - last_processed_batch_timestamp >= self.throttle_seconds):
|
||||||
|
last_processed_batch_timestamp = time.time()
|
||||||
self.logger.info('Processing feeds batch for Adafruit IO')
|
self.logger.info('Processing feeds batch for Adafruit IO')
|
||||||
|
|
||||||
for (feed, values) in data.items():
|
for (feed, values) in data.items():
|
||||||
if values:
|
if values:
|
||||||
self.send(feed, values, enqueue=False)
|
self.send(feed, values, enqueue=False)
|
||||||
|
|
||||||
last_processed_batch_timestamp = time.time()
|
|
||||||
data = {}
|
data = {}
|
||||||
|
|
||||||
return run
|
return run
|
||||||
|
|
Loading…
Reference in a new issue