Use ThreadGroup.add_timer() API correctly
Nothing is calling add_timer with arguments to the callback function, but if it did they would be passed incorrectly. Change-Id: I92cdab66d1c826a24aef473946e9cc0346296e3b
This commit is contained in:
parent
8f340b2e0e
commit
fb888e3fa9
|
@ -158,7 +158,7 @@ class ThreadGroupManager(object):
|
||||||
The task will be executed in a separate green thread.
|
The task will be executed in a separate green thread.
|
||||||
Interval is from cfg.CONF.periodic_interval
|
Interval is from cfg.CONF.periodic_interval
|
||||||
"""
|
"""
|
||||||
timer = self.group.add_timer(interval, func, *args, **kwargs)
|
timer = self.group.add_timer(interval, func, None, *args, **kwargs)
|
||||||
return timer
|
return timer
|
||||||
|
|
||||||
def stop_timers(self):
|
def stop_timers(self):
|
||||||
|
|
|
@ -70,7 +70,8 @@ class SchedulerTest(base.SenlinTestCase):
|
||||||
tgm = scheduler.ThreadGroupManager()
|
tgm = scheduler.ThreadGroupManager()
|
||||||
mock_group.add_timer.assert_called_once_with(
|
mock_group.add_timer.assert_called_once_with(
|
||||||
cfg.CONF.periodic_interval,
|
cfg.CONF.periodic_interval,
|
||||||
tgm._service_task)
|
tgm._service_task,
|
||||||
|
None)
|
||||||
|
|
||||||
def test_start(self):
|
def test_start(self):
|
||||||
def f():
|
def f():
|
||||||
|
|
Loading…
Reference in New Issue