mirror of
https://github.com/clearml/clearml
synced 2025-03-03 10:42:00 +00:00
Fix don't crash on semaphore acquire error
This commit is contained in:
parent
f37e036e51
commit
999e8d39ba
@ -84,7 +84,11 @@ class ForkSemaphore(_ForkSafeThreadSyncObject):
|
||||
super(ForkSemaphore, self).__init__(functor=partial(Semaphore, value))
|
||||
|
||||
def acquire(self, *args, **kwargs):
|
||||
try:
|
||||
self._create()
|
||||
except BaseException: # noqa
|
||||
return None
|
||||
|
||||
return self._sync.acquire(*args, **kwargs)
|
||||
|
||||
def release(self, *args, **kwargs):
|
||||
|
Loading…
Reference in New Issue
Block a user