Merge "Avoid removing entries for timers that didn't stop"
This commit is contained in:
commit
8b2f286e04
@ -120,12 +120,19 @@ class ThreadGroup(object):
|
||||
lambda x: LOG.exception(_LE('Error stopping thread.')))
|
||||
|
||||
def stop_timers(self):
|
||||
stopped_timers = []
|
||||
for x in self.timers:
|
||||
try:
|
||||
x.stop()
|
||||
except Exception:
|
||||
LOG.exception(_LE('Error stopping timer.'))
|
||||
self.timers = []
|
||||
else:
|
||||
stopped_timers.append(x)
|
||||
for x in stopped_timers:
|
||||
try:
|
||||
self.timers.remove(x)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
def stop(self, graceful=False):
|
||||
"""stop function has the option of graceful=True/False.
|
||||
|
Loading…
x
Reference in New Issue
Block a user