Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

Conversation

@amineau
Copy link

@amineau amineau commented Apr 1, 2021

Adding a check for postgresql to avoid the loss of a request.

The connection.cursor() opens a connection for CONN_MAX_AGE time if it is not already open.
Otherwise, the old cursor is used and no verification is done.

This is inspired by the is_usable() method of django.
https://github.com/django/django/blob/76c0b32f826469320c59709d31e2f2126dd7c505/django/db/backends/postgresql/base.py#L298

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant