jdelic / django-dbconn-retry

Patches Django to reconnect on a failed database connection once before failing. Helping with running Django ORM through HAProxy, for example.
BSD 3-Clause "New" or "Revised" License
76 stars 25 forks source link

handle transaction.atomic #41

Open rooterkyberian opened 1 year ago

rooterkyberian commented 1 year ago

Seems the most straight forward thing would to not attempt retries when are in transaction, as that can only lead to some terrible bugs.

aebrahimian commented 10 months ago

I think calling self.close() is safer than self.connection = None when the connection is closed (here) it prevent reconnection when you are in atomic transaction block