my Python Flask-restful API exposes a GET endpoint, /get_value
, which takes some time to run, and it's crucial that this operation occurs in the fastest time possible. Please consider that multiple requests may occur in sequence from a client application.
Now, I want to store on a DB a log record everytime the /get_value
endpoint is called, without affecting the API response (writing on a DB is an overhead I can't have while producing the GET response!). The record insertion into the DB has a low priority, and could be done even one day after that the endpoint is called...
Which is the best practice for doing this? Does Flask support a function for that?
Thanks!