From d5471d623777846263b74bfd8b6bd2cb1f16590a Mon Sep 17 00:00:00 2001 From: M Alfiyan Syamsuddin Date: Thu, 2 Sep 2021 13:39:17 +0700 Subject: [PATCH] if monthly archive defined, allow up to ~1 month old uptime date --- src/psm/Util/Server/Archiver/UptimeArchiver.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/psm/Util/Server/Archiver/UptimeArchiver.php b/src/psm/Util/Server/Archiver/UptimeArchiver.php index f4430c74..de1305b6 100644 --- a/src/psm/Util/Server/Archiver/UptimeArchiver.php +++ b/src/psm/Util/Server/Archiver/UptimeArchiver.php @@ -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 {