mirror of
https://github.com/clearml/clearml
synced 2025-03-03 10:42:00 +00:00
Fix shutting down a Task immediately after creation might block
This commit is contained in:
parent
899ff93a73
commit
350a39b886
@ -61,8 +61,9 @@ class SafeQueue(object):
|
|||||||
return self._q.empty() and (not self._internal_q or self._internal_q.empty())
|
return self._q.empty() and (not self._internal_q or self._internal_q.empty())
|
||||||
|
|
||||||
def is_pending(self):
|
def is_pending(self):
|
||||||
|
# check if we have pending requests to be pushed (it does not mean they were pulled)
|
||||||
# only call from main put process
|
# only call from main put process
|
||||||
return self._q_size > 0 or not self.empty()
|
return self._q_size > 0
|
||||||
|
|
||||||
def close(self, event):
|
def close(self, event):
|
||||||
# wait until all pending requests pushed
|
# wait until all pending requests pushed
|
||||||
|
Loading…
Reference in New Issue
Block a user