mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-02-16 19:40:59 +03:00
Merge branch 'release/4.31.1' into master
This commit is contained in:
commit
d04596be73
|
@ -7,6 +7,12 @@ that were made in every particular version.
|
||||||
From version 0.7.6 *Dependency Injector* framework strictly
|
From version 0.7.6 *Dependency Injector* framework strictly
|
||||||
follows `Semantic versioning`_
|
follows `Semantic versioning`_
|
||||||
|
|
||||||
|
4.31.1
|
||||||
|
------
|
||||||
|
- Fix ``ThreadSafeSingleton`` synchronization issue.
|
||||||
|
See issue: `#433 <https://github.com/ets-labs/python-dependency-injector/issues/433>`_.
|
||||||
|
Thanks to `@garlandhu <https://github.com/garlandhu>`_ for reporting the issue.
|
||||||
|
|
||||||
4.31.0
|
4.31.0
|
||||||
------
|
------
|
||||||
- Implement providers' lazy initialization.
|
- Implement providers' lazy initialization.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""Top-level package."""
|
"""Top-level package."""
|
||||||
|
|
||||||
__version__ = '4.31.0'
|
__version__ = '4.31.1'
|
||||||
"""Version number.
|
"""Version number.
|
||||||
|
|
||||||
:type: str
|
:type: str
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2819,17 +2819,14 @@ cdef class ThreadSafeSingleton(BaseSingleton):
|
||||||
if instance is None:
|
if instance is None:
|
||||||
with self.__storage_lock:
|
with self.__storage_lock:
|
||||||
if self.__storage is None:
|
if self.__storage is None:
|
||||||
instance = __factory_call(self.__instantiator, args, kwargs)
|
result = __factory_call(self.__instantiator, args, kwargs)
|
||||||
|
if __is_future_or_coroutine(result):
|
||||||
if __is_future_or_coroutine(instance):
|
|
||||||
future_result = asyncio.Future()
|
future_result = asyncio.Future()
|
||||||
instance = asyncio.ensure_future(instance)
|
result = asyncio.ensure_future(result)
|
||||||
instance.add_done_callback(functools.partial(self._async_init_instance, future_result))
|
result.add_done_callback(functools.partial(self._async_init_instance, future_result))
|
||||||
self.__storage = future_result
|
result = future_result
|
||||||
return future_result
|
self.__storage = result
|
||||||
|
instance = self.__storage
|
||||||
self.__storage = instance
|
|
||||||
|
|
||||||
return instance
|
return instance
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user