I'm working on a project for my company. Essentially we are going to have a long running process that will hit APIs on a python server to send and recieve JSON responses. It will take the data from these API calls and update tables in a mysql database. It will be responsive, but also perform scheduled tasks.
The code is written and it functions properly. The question is, how do you execute this intelligently? While being memory conscious.
Much like this question I am at the moment, very regretfully and in spite of my many reservations, using a while(true)
loop to run infinitely with a sleep of 15 seconds after everything finishes. The referenced question didn't have very many viable answers and is nearly 3 years old. Any suggestions on how to execute this in a way that will be memory friendly and intelligent.