Cache for 12 hours

This commit is contained in:
Ibnu Maksum 2024-02-06 16:43:06 +07:00
parent 009c890ab6
commit 1e0b246d74
No known key found for this signature in database
GPG key ID: 7FC82848810579E5

View file

@ -124,8 +124,8 @@ if(file_exists($cacheMRfile) && time()- filemtime($cacheMRfile) < 3600){
} }
$cacheMSfile = File::pathFixer('system/cache/monthlySales.json'); $cacheMSfile = File::pathFixer('system/cache/monthlySales.json');
//Cache for 24 hours //Cache for 12 hours
if(file_exists($cacheMSfile) && time()- filemtime($cacheMSfile) < 86400){ if(file_exists($cacheMSfile) && time()- filemtime($cacheMSfile) < 43200){
$monthlySales = json_decode(file_get_contents($cacheMSfile), true); $monthlySales = json_decode(file_get_contents($cacheMSfile), true);
}else{ }else{
// Query to retrieve monthly data // Query to retrieve monthly data