Changeset View
Changeset View
Standalone View
Standalone View
python_modules/libraries/dagster-mysql/dagster_mysql/utils.py
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | while True: | ||||
try: | try: | ||||
return fn() | return fn() | ||||
except ( | except ( | ||||
mysql.DatabaseError, | mysql.DatabaseError, | ||||
mysql.OperationalError, | mysql.OperationalError, | ||||
db.exc.DatabaseError, | db.exc.DatabaseError, | ||||
db.exc.OperationalError, | db.exc.OperationalError, | ||||
mysql.errors.InterfaceError, | |||||
) as exc: | ) as exc: | ||||
logging.warning("Retrying failed database connection") | logging.warning("Retrying failed database connection") | ||||
if retry_limit == 0: | if retry_limit == 0: | ||||
raise DagsterMySQLException("too many retries for DB connection") from exc | raise DagsterMySQLException("too many retries for DB connection") from exc | ||||
time.sleep(retry_wait) | time.sleep(retry_wait) | ||||
retry_limit -= 1 | retry_limit -= 1 | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |