Skip to content

Commit

Permalink
fix multiprocessing mode (#782)
Browse files Browse the repository at this point in the history
* fix multiprocessing mode

* version: 1.23.6
  • Loading branch information
roman-right committed Nov 13, 2023
1 parent f9f96a9 commit 6864b36
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion beanie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion beanie/odm/utils/init.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
import sys

from beanie.odm.utils.pydantic import (
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Beanie project

## [1.23.6] - 2023-11-12
### Fix Multiprocessing Mode
- Author - [Roman Right](https://github.com/roman-right)
- PR <https://github.com/roman-right/beanie/pull/782>

[1.23.6]: https://pypi.org/project/beanie/1.23.6

## [1.23.5] - 2023-11-12
### Multiprocessing Mode For Init
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_beanie.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def test_version():
assert __version__ == "1.23.5"
assert __version__ == "1.23.6"

0 comments on commit 6864b36

Please sign in to comment.