Don't loop endlessly on shutdown/restart

This commit is contained in:
Ruud
2012-01-27 11:49:18 +01:00
parent d38ff40b54
commit 6e243a1291
+8 -5
View File
@@ -70,17 +70,20 @@ class Core(Plugin):
fireEvent('app.shutdown') fireEvent('app.shutdown')
while 1: loop = True
while loop:
still_running = fireEvent('plugin.running') still_running = fireEvent('plugin.running')
brk = True if len(still_running) == 0:
break
log.debug('Still running: %s' % still_running)
for running in still_running: for running in still_running:
running = list(set(running) - set(self.ignore_restart)) running = list(set(running) - set(self.ignore_restart))
if len(running) > 0: if len(running) > 0:
log.info('Waiting on plugins to finish: %s' % running) log.info('Waiting on plugins to finish: %s' % running)
brk = False else:
loop = False
if brk: break
time.sleep(1) time.sleep(1)