diff options
author | Kali Kaneko <kali@leap.se> | 2014-05-13 01:55:28 -0500 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2014-05-13 01:55:28 -0500 |
commit | 02b7b4a35d45671542f1e665767e9227c81207af (patch) | |
tree | 6d73dec475aa43dc782f37fae6e7ba8404efb935 /src/leap/bitmask/backend.py | |
parent | 66c94c7533a81cf9512b41090ccab4ee8360e611 (diff) |
give some time for eip to shudown on bundle. Closes: #5663
Diffstat (limited to 'src/leap/bitmask/backend.py')
-rw-r--r-- | src/leap/bitmask/backend.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/leap/bitmask/backend.py b/src/leap/bitmask/backend.py index 41fdc06e..a351a477 100644 --- a/src/leap/bitmask/backend.py +++ b/src/leap/bitmask/backend.py @@ -25,6 +25,7 @@ import time from functools import partial from Queue import Queue, Empty +from twisted.internet import reactor from twisted.internet import threads, defer from twisted.internet.task import LoopingCall from twisted.python import log @@ -899,9 +900,17 @@ class Backend(object): """ Stops the looping call and tries to cancel all the defers. """ + reactor.callLater(2, self._stop) + + def _stop(self): + """ + Delayed stopping of worker. Called from `stop`. + """ log.msg("Stopping worker...") if self._lc.running: self._lc.stop() + else: + logger.warning("Looping call is not running, cannot stop") while len(self._ongoing_defers) > 0: d = self._ongoing_defers.pop() d.cancel() |