Skip to content

Commit 98b8ae7

Browse files
committed
format docs
1 parent 30c21f8 commit 98b8ae7

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

docs/pages/lifetimes_and_scopes.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,12 @@ async def process_batch(
245245
) -> list[Result]:
246246
# RequestContext and TenantContext are shared while everything else is isolated per worker.
247247
async def process_one(doc_id: str) -> Result:
248-
async with container.enter_scope({
249-
RequestContext: request_ctx,
250-
TenantContext: tenant_ctx,
251-
}) as scope:
248+
async with container.enter_scope(
249+
{
250+
RequestContext: request_ctx,
251+
TenantContext: tenant_ctx,
252+
}
253+
) as scope:
252254
# DocumentService and all its dependencies (db connections, transactions, etc.)
253255
# are isolated per worker
254256
document_service = await scope.get(DocumentService)
@@ -266,7 +268,8 @@ from wireup import ScopedAsyncContainer, injectable
266268
@injectable(lifetime="scoped")
267269
class WorkerService:
268270
def __init__(
269-
self, scope: ScopedAsyncContainer,
271+
self,
272+
scope: ScopedAsyncContainer,
270273
request_ctx: RequestContext,
271274
) -> None:
272275
self.scope = scope

docs/pages/migrate_to_wireup/fastapi_depends.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,9 @@ returned object is mutable and the cache is not reset.
225225

226226

227227
@app.get("/weather")
228-
async def weather(client: Annotated[aiohttp.ClientSession, Depends(get_http_client)]): ...
228+
async def weather(
229+
client: Annotated[aiohttp.ClientSession, Depends(get_http_client)],
230+
): ...
229231
```
230232

231233
This also means nothing that relies on `get_http_client` can be a singleton that is evaluated only once, any dependency

0 commit comments

Comments
 (0)