agroportal / fairness

This project is a FAIRness assessment tool for ontologies, vocabularies and semantic resources.
http://services.stageportal.lirmm.fr/fairness/v2/
MIT License
13 stars 5 forks source link

Fairness cache update #31

Open rasmi-aw opened 1 year ago

rasmi-aw commented 1 year ago

Hello @syphax-bouazzouni @EamdouniGIT @jonquet , i hope you're doing good, Fairness results file can be updated externally by whether a job or command, now i just made it auto updating every 12 hours (Configurable), without the interference of anybody, which means by the easiest way recalculating the results every 12 hours, this will help in case of a not working script etc...

(deleting the cache file is triggered by an http request (normal fetch fair requests))

Thanks.

syphax-bouazzouni commented 1 year ago

Hi,

OK a really good contribution 👍

I will review the code and merge it after,

For now here are some remarks:

When you do a PR, it really important to tell the current context and the what, how and why of you work explicitly (it is even more important when you speak to no technical people)

In your case:

Context (How the current cache works ?)

Currently there is a cron job (a linux script) that each night delete the fairness cache file. And like the fairness service check at each request the existence of the cache file to use it, if it can't be found he regenerate it and so the cache is renewed.

The issue (the why)

To make this work we need an external script (that needed to be installed in the deployed system),

What and how

This PR make the fairness service remove by his own the cache file (without an external script job) after an amount of time (UPDATE_RATE variable)