diff options
Diffstat (limited to 'lib/git/async/thread.py')
-rw-r--r-- | lib/git/async/thread.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/git/async/thread.py b/lib/git/async/thread.py index 7ca93c86..82acbd8f 100644 --- a/lib/git/async/thread.py +++ b/lib/git/async/thread.py @@ -139,10 +139,15 @@ class WorkerThread(TerminatableThread): if self._should_terminate(): break # END check for stop request - routine = self.__class__.quit + routine = None args = tuple() kwargs = dict() - tasktuple = self.inq.get() + # don't wait too long, instead check for the termination request more often + try: + tasktuple = self.inq.get(True, 1) + except Queue.Empty: + continue + # END get task with timeout if isinstance(tasktuple, (tuple, list)): if len(tasktuple) == 3: |