Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek authored Jan 18, 2024
1 parent 0e4f6fe commit 0744959
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/source/dev/database_session_management.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The default scope of the Session object registry is [thread local](https://docs.

### WSGI, ASGI, Celery

In the context of the web app (WSGI and ASGI) there is a clearly delineated lifespan for a session, and that lifespan isn't tied to a thread. The scope of the Session object registry is set at the beginning of a web request using `app.model.set_request_id(request_id)`. At the end of a web request we remove the scope using `app.model.unset_request_id(request_id)`. This also closes and removes any action Session object. Similarly, we set the scope for each Celery task execution using `set_request_id` and `unset_request_id`.
In the context of the web app (WSGI and ASGI) there is a clearly delineated lifespan for a session, and that lifespan isn't tied to a thread. The scope of the Session object registry is set at the beginning of a web request using `app.model.set_request_id(request_id)`. At the end of a web request we remove the scope using `app.model.unset_request_id(request_id)`. This also closes and removes any active Session object. Similarly, we set the scope for each Celery task execution using `set_request_id` and `unset_request_id`.

By using this mechanism we are certain that web requests and celery tasks receive a new Session object and that any resources held by the session are released.

Expand Down

0 comments on commit 0744959

Please sign in to comment.