This changes the order of checks for an updated publication period:
check for zero period first, and if this is the case, stop sending
the periodic model publications.
Change-Id: I2693c5a593fa23e59dd2e015348f1fd96a30c88f
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
def set_publication(self, period):
- # We do not handle ms in this example
- if period < 1000:
- return
-
self.pub_period = period
if period == 0:
self.timer.cancel()
return
+ # We do not handle ms in this example
+ if period < 1000:
+ return
+
self.timer.start(period/1000, self.publish)
def publish(self):