Skip to content

Commit c9031c6

Browse files
author
Paul Decoursey
committed
back off on the retries.
1 parent 9a7297a commit c9031c6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

apiary/connect_mysql.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import os
66
import MySQLdb as mdb
77
import logging
8+
import time
89

910

1011
LOGGER = logging.getLogger()
@@ -74,6 +75,8 @@ def fetchall(self, sql, retry_count=0):
7475
cur.execute(sql)
7576
return cur.fetchall()
7677
except mdb.OperationalError:
78+
if retry_count:
79+
time.sleep(retry_count)
7780
if retry_count > 10: # seemed like a good count
7881
raise Exception("max retries...")
7982
self.reconnect()

0 commit comments

Comments
 (0)