From 26e39000c29844d49ed4d714befb5220fc19ed28 Mon Sep 17 00:00:00 2001 From: Vinod Date: Fri, 23 Dec 2016 04:39:59 -0800 Subject: [PATCH] Clean up timer thread remove unnecessary is_running conditional check Change-Id: I7bcba9d93ea7d9c1b2ed72ba142d021728fb7192 --- cloudpulse/common/timerthread.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cloudpulse/common/timerthread.py b/cloudpulse/common/timerthread.py index d2ded2f..b3870a1 100755 --- a/cloudpulse/common/timerthread.py +++ b/cloudpulse/common/timerthread.py @@ -43,19 +43,15 @@ class cpulseTimer(object): self.function = function self.args = args self.kwargs = kwargs - self.is_running = False self.start() def _run(self): - self.is_running = False self.start() self.function(self, *self.args, **self.kwargs) def start(self): - if not self.is_running: - self._timer = Timer(self.interval, self._run) - self._timer.start() - self.is_running = True + self._timer = Timer(self.interval, self._run) + self._timer.start() def test_run(**kwargs):