if monthly archive defined, allow up to ~1 month old uptime date

This commit is contained in:
M Alfiyan Syamsuddin 2021-09-02 13:39:17 +07:00
parent f03ab5065c
commit d5471d6237
1 changed files with 6 additions and 1 deletions

View File

@ -66,7 +66,12 @@ class UptimeArchiver implements ArchiverInterface
public function archive($server_id = null)
{
// WIP, create more dynamic by config, temp use config.php
$latest_date = new \DateTime('-1 week 0:0:0');
if(PSM_UPTIME_ARCHIVE == 'monthly'){
$latest_date = new \DateTime('-1 month 0:0:0');
}else{
$latest_date = new \DateTime('-1 week 0:0:0');
}
// Lock tables to prevent simultaneous archiving (by other sessions or the cron job)
try {