I\'ve an API hosted on Flask. It runs behind a Tornado server. What is happening is that sometimes changes made on the UI are not reflected in the database. Also a few of th
Per my experience, I think may be you can try to use the code below to implement the retry logic.
import time
retry_flag = True
retry_count = 0
while retry_flag and retry_count < 5:
try:
cursor.execute(query, [args['type'], args['id']])
retry_flag = False
except:
print "Retry after 1 sec"
retry_count = retry_count + 1
time.sleep(1)
Hope it helps.