Skip to content

Commit

Permalink
Fixed #15119 -- Stopped pinging the MySQL server.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaugustin committed Feb 18, 2013
1 parent aea98e8 commit 282b2f4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
5 changes: 1 addition & 4 deletions django/db/backends/__init__.py
Expand Up @@ -53,11 +53,8 @@ def __ne__(self, other):

__hash__ = object.__hash__

def _valid_connection(self):
return self.connection is not None

def _cursor(self):
if not self._valid_connection():
if self.connection is None:
conn_params = self.get_connection_params()
self.connection = self.get_new_connection(conn_params)
self.init_connection_state()
Expand Down
9 changes: 0 additions & 9 deletions django/db/backends/mysql/base.py
Expand Up @@ -402,15 +402,6 @@ def __init__(self, *args, **kwargs):
self.introspection = DatabaseIntrospection(self)
self.validation = DatabaseValidation(self)

def _valid_connection(self):
if self.connection is not None:
try:
self.connection.ping()
return True
except DatabaseError:
self.close()
return False

def get_connection_params(self):
kwargs = {
'conv': django_conversions,
Expand Down

0 comments on commit 282b2f4

Please sign in to comment.