faster shutdown
This commit is contained in:
parent
c844aae72e
commit
a0b16fc841
2 changed files with 5 additions and 4 deletions
|
@ -481,7 +481,7 @@ class Nodes(Thread):
|
|||
for node in list(self._nodes.values()):
|
||||
if self._running:
|
||||
node.online = node.can_connect()
|
||||
if node.online:
|
||||
if self._running and node.online:
|
||||
node.pullChanges()
|
||||
self._pulling = False
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ class Tasks(Thread):
|
|||
from user.models import export_list, update_user_peering
|
||||
while self.connected:
|
||||
m = self.q.get()
|
||||
if m:
|
||||
if m and self.connected:
|
||||
try:
|
||||
action, data = m
|
||||
logger.debug('%s start', action)
|
||||
|
@ -60,6 +60,7 @@ class Tasks(Thread):
|
|||
return Thread.join(self)
|
||||
|
||||
def queue(self, action, data=None):
|
||||
logger.debug('%s queued', action)
|
||||
self.q.put((action, data))
|
||||
if self.connected:
|
||||
logger.debug('%s queued', action)
|
||||
self.q.put((action, data))
|
||||
|
||||
|
|
Loading…
Reference in a new issue