diff --git a/beanie/__init__.py b/beanie/__init__.py index 6485a834..895a1dac 100644 --- a/beanie/__init__.py +++ b/beanie/__init__.py @@ -32,7 +32,7 @@ from beanie.odm.utils.init import init_beanie from beanie.odm.views import View -__version__ = "1.23.5" +__version__ = "1.23.6" __all__ = [ # ODM "Document", diff --git a/beanie/odm/utils/init.py b/beanie/odm/utils/init.py index a70b905b..a7b73228 100644 --- a/beanie/odm/utils/init.py +++ b/beanie/odm/utils/init.py @@ -1,3 +1,4 @@ +import asyncio import sys from beanie.odm.utils.pydantic import ( @@ -104,7 +105,7 @@ def __init__( self.database: AsyncIOMotorDatabase = database if multiprocessing_mode: - self.database.client.get_io_loop = self.database.get_io_loop + self.database.client.get_io_loop = asyncio.get_running_loop sort_order = { ModelType.UnionDoc: 0, diff --git a/docs/changelog.md b/docs/changelog.md index 4c7f911c..34dfb0e2 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,14 @@ Beanie project +## [1.23.6] - 2023-11-12 + +### Fix Multiprocessing Mode +- Author - [Roman Right](https://github.com/roman-right) +- PR + +[1.23.6]: https://pypi.org/project/beanie/1.23.6 + ## [1.23.5] - 2023-11-12 ### Multiprocessing Mode For Init diff --git a/pyproject.toml b/pyproject.toml index 2fea59d0..70c26683 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "beanie" -version = "1.23.5" +version = "1.23.6" description = "Asynchronous Python ODM for MongoDB" readme = "README.md" requires-python = ">=3.7,<4.0" diff --git a/tests/test_beanie.py b/tests/test_beanie.py index 25076897..e68cf217 100644 --- a/tests/test_beanie.py +++ b/tests/test_beanie.py @@ -2,4 +2,4 @@ def test_version(): - assert __version__ == "1.23.5" + assert __version__ == "1.23.6"