Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
django-db-connection-retrier
Automatically ty re-establishing the Django database connection when it gets lost.
Readme
Automatically try to re-establish Django database connections when they fail due to DNS errors.
When the Django app (dbconnectionretrier
) loads, a hook is installed in Django's BaseDatabaseWrapper.ensure_connection
that catches django.db.OperationalError
. If the error raised is a DNS error, the connction attempt is retried synchronously three times.
Tested on Django 2.0-2.3 and Python 3.7 and 3.8. Might work with other versions of Django and Python.
Install the package from PyPi:
$ pip install django-db-connection-retrier
Add dbconnectionretrier
to your INSTALLED_APPS
:
INSTALLED_APPS = [
'dbconnectionretrier',
...
]
Adding dbconnectionretrier
to INSTALLED_APPS
enables automatic connection retrying. Want more granular control over patching?
from dbconnectionretrier.patch import patch_ensure_connection
# after this line executes, connection retrying is enabled
patch = patch_ensure_connection()
# after this line, the connection retrying is disabled
patch.rollback()
from dbconnectionretrier.patch import patch_ensure_connection_contextual
with patch_ensure_connection_contextual():
# all code inside this block benefits from connection retrying
FAQs
Automatically ty re-establishing the Django database connection when it gets lost.
We found that django-db-connection-retrier demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.