djangosnippets.org: Latest snippets tagged with 'socket'https://djangosnippets.org/tags/socket/2013-06-28T01:48:51.902847-05:00Multi-DB Reconnecting Persistent Postgres Connection
2013-06-28T01:48:51.902847-05:00cronosahttps://djangosnippets.org/snippets/2965/<p>This is a modification of http://djangosnippets.org/snippets/1707/ that handles the database going down or PG Bouncer killing the connection. This also works in things like Twisted to make sure the connection is alive before doing a real query. Thanks @mike_tk for the original post!</p>
<p>EDIT: Updated the wrapper to handle multi-db. …</p>
Freely redistributable