Skip to content

Commit bcb2d78

Browse files
authored
Merge pull request #23 from taskiq-python/bugfix/shared-state
2 parents b04ca14 + 429345e commit bcb2d78

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

taskiq_fastapi/initializator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import copy
12
from typing import Any, Awaitable, Callable, Mapping, Optional, Union
23

34
from fastapi import FastAPI, Request
@@ -112,10 +113,10 @@ def populate_dependency_context(
112113
broker.dependency_overrides.update(
113114
{
114115
Request: lambda: Request(
115-
scope={"app": app, "type": "http", "state": asgi_state},
116+
scope={"app": app, "type": "http", "state": copy.copy(asgi_state)},
116117
),
117118
HTTPConnection: lambda: HTTPConnection(
118-
scope={"app": app, "type": "http", "state": asgi_state},
119+
scope={"app": app, "type": "http", "state": copy.copy(asgi_state)},
119120
),
120121
},
121122
)

0 commit comments

Comments
 (0)