I am writing a database application where song from the database may need updates according to time, not based on user actions.
For instance, there might be certain values which are up-to-date daily, and certain other values that must definitely be up-to-date say, four hrs following the database entry is produced.
Thus I want a way to update values regularly (a script that updates the database daily) and a method to update values in a specific time later on (once the entry is produced, you have to run an update in four hrs).
The database is going to be handled via a web front-end, so I am using Django to setup the database and also the administration, because Django makes creating the database a pleasure. However, I've no clue how to setup sleep issues, along side it that updates the database at certain occasions.
Wouldso would everyone suggest carrying this out? Will it be sufficient to operate a python script and run it having a daily cronjob, or isn't that the very best practice? Is kind of factor done frequently, and do tools / techniques exist to get this done?
I've no training with this particular kind of factor, and Let me understand how it's generally done before I begin and begin reinventing the wheel.
You are able to set an administration task (one that is known as with
./manage.py <task name>) that does the thing you need. By doing this you have use of all of the configurations, models and stuff that you employ inside your project. Also it's simple to maintain this type of script.