I have a requirement to restart the Opensift container on everday 10 AM and execute a pre-script to perform file downloads.
Since my flask app is running on gunicorn 4 worker, i cannot place the file download logic on the flask application as it execute download logic on 4 times.
i.e. I have python flask app running in the Openshift which utilizes the 10 files (dynamic file with daily update). So case here is,
- download the new files on daily 10 AM
- Once new files are downloaded, restart the container. (restarted app will use the new files as it is arrived in the Persistent volume)
Please suggest how smart we can achieve it using liveness/readiness probe or any other way please suggest.