Skip to content

Commit

Permalink
Updated loader.py so it repeats failing queries fewer times and with …
Browse files Browse the repository at this point in the history
…smaller timeouts.
  • Loading branch information
gaurav committed Apr 18, 2012
1 parent 7055203 commit 11f0f21
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion workflow/mol-data/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ def sendSQLStatementToCartoDB(sql):

# print "Executing SQL: «%s»" % sql
if not _getoptions().dummy_run:
tries = 50
tries = 10

while (tries > 0):
try:
Expand All @@ -521,6 +521,7 @@ def sendSQLStatementToCartoDB(sql):
except CartoDBException as e:
#if str(e) == 'internal server error' or str(e) == 'current transaction is aborted, commands ignored until end of transaction block':
logging.info("\t CartoDB exception caught ('%s'), retrying ...", e)
time.sleep(random.randint(3,9))
result = None
tries = tries - 1

Expand Down

0 comments on commit 11f0f21

Please sign in to comment.