我有一个函数,使用
threading
模块,每小时执行一次。但是我遇到了一些问题。
即,该功能在几个小时后就不运行了,比如10-12小时后(这个时间是变化的)。
def update_df():
df = pd.read_sql(sql_query, connections['DB2'])
threading.Timer(60*60*1, update_df).start()
update_df()
Questions:
What is best practice, to implement this function such that it
should run for every IST hour(not on system time)?
Why threading module haven't worked properly (Is there any built-in module to do same job)?
Edit-1:
Question-1 is sovled
Question-2 need more visibility