equal
deleted
inserted
replaced
347 threading.currentThread()) |
347 threading.currentThread()) |
348 def shutdown(self): |
348 def shutdown(self): |
349 """called on server stop event to properly close opened sessions and |
349 """called on server stop event to properly close opened sessions and |
350 connections |
350 connections |
351 """ |
351 """ |
|
352 assert not self._shutting_down, 'already shutting down' |
352 self._shutting_down = True |
353 self._shutting_down = True |
353 if isinstance(self._looping_tasks, tuple): # if tasks have been started |
354 if isinstance(self._looping_tasks, tuple): # if tasks have been started |
354 for looptask in self._looping_tasks: |
355 for looptask in self._looping_tasks: |
355 self.info('canceling task %s...', looptask.name) |
356 self.info('canceling task %s...', looptask.name) |
356 looptask.cancel() |
357 looptask.cancel() |