From b777bbcfa8b276c3b7de4e8eaa94e26b3f59bda4 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 25 Jul 2018 02:21:38 +0200 Subject: [PATCH] Reset the timer as soon as you start processing the batch --- platypush/plugins/adafruit/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platypush/plugins/adafruit/io.py b/platypush/plugins/adafruit/io.py index d5fdf5d34..4658277f1 100644 --- a/platypush/plugins/adafruit/io.py +++ b/platypush/plugins/adafruit/io.py @@ -95,13 +95,13 @@ class AdafruitIoPlugin(Plugin): if data and (last_processed_batch_timestamp is None or time.time() - last_processed_batch_timestamp >= self.throttle_seconds): + last_processed_batch_timestamp = time.time() self.logger.info('Processing feeds batch for Adafruit IO') for (feed, values) in data.items(): if values: self.send(feed, values, enqueue=False) - last_processed_batch_timestamp = time.time() data = {} return run