hug
hug copied to clipboard
Global Variables / State Management
I am trying to build an API that initially queries a database and stores the data in a dataframe that the different endpoints read from.
The problem is, I need to update this dataframe every 15 and the call takes a decent amount of time.
What is the best way to manage the global df and have it call a database every 15 minutes?
I tried using a middleware function but it cannot access the global "df".