How to set a timeout for a pymysql query -
i have situation pymysql query may take longer amount of time allowed. ideally, call aborts exception after set number of seconds or mills, can reported , move forward.
is there way limit amount of time query can execute given session/connection?
based on this answer can do:
with timeout(seconds=3): cursor.execute('your sql query')
Comments
Post a Comment