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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -