diff --git a/.env b/.env index 02e645d9b..c616312e5 100644 --- a/.env +++ b/.env @@ -77,7 +77,7 @@ _APP_MAINTENANCE_RETENTION_EXECUTION=1209600 _APP_MAINTENANCE_RETENTION_ABUSE=86400 _APP_MAINTENANCE_RETENTION_AUDIT=1209600 _APP_USAGE_AGGREGATION_INTERVAL=5 -_APP_MAINTENANCE_RETENTION_HOURLY_USAGE=8640000 +_APP_MAINTENANCE_RETENTION_USAGE_HOURLY=8640000 _APP_USAGE_STATS=enabled _APP_LOGGING_PROVIDER= _APP_LOGGING_CONFIG= diff --git a/Dockerfile b/Dockerfile index 9f0d71c7b..725fcaa46 100755 --- a/Dockerfile +++ b/Dockerfile @@ -252,7 +252,7 @@ ENV _APP_SERVER=swoole \ _APP_MAINTENANCE_RETENTION_AUDIT=1209600 \ # 1 Day = 86400 s _APP_MAINTENANCE_RETENTION_ABUSE=86400 \ - _APP_MAINTENANCE_RETENTION_HOURLY_USAGE=8640000 \ + _APP_MAINTENANCE_RETENTION_USAGE_HOURLY=8640000 \ _APP_MAINTENANCE_INTERVAL=86400 \ _APP_LOGGING_PROVIDER= \ _APP_LOGGING_CONFIG= diff --git a/app/config/variables.php b/app/config/variables.php index d00e0e10c..dbfabaab7 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -859,7 +859,7 @@ return [ 'filter' => '' ], [ - 'name' => '_APP_MAINTENANCE_RETENTION_HOURLY_USAGE', + 'name' => '_APP_MAINTENANCE_RETENTION_USAGE_HOURLY', 'description' => 'The maximum duration (in seconds) upto which to retain hourly usage metrics. The default value is 8640000 seconds (100 days).', 'introduction' => '', 'default' => '8640000', diff --git a/app/tasks/maintenance.php b/app/tasks/maintenance.php index e7c6063f6..92f260ce4 100644 --- a/app/tasks/maintenance.php +++ b/app/tasks/maintenance.php @@ -78,11 +78,11 @@ $cli ->trigger(); } - function notifyDeleteUsageStats(int $hourlyRetentionInterval) + function notifyDeleteUsageStats(int $usageStatsRetentionHourly) { (new Delete()) ->setType(DELETE_TYPE_USAGE) - ->setHourlyUsageRetentionDatetime(DateTime::addSeconds(new \DateTime(), -1 * $hourlyRetentionInterval)) + ->setUsageRetentionHourlyDateTime(DateTime::addSeconds(new \DateTime(), -1 * $usageStatsRetentionHourly)) ->trigger(); } @@ -143,11 +143,11 @@ $cli $executionLogsRetention = (int) App::getEnv('_APP_MAINTENANCE_RETENTION_EXECUTION', '1209600'); $auditLogRetention = (int) App::getEnv('_APP_MAINTENANCE_RETENTION_AUDIT', '1209600'); $abuseLogsRetention = (int) App::getEnv('_APP_MAINTENANCE_RETENTION_ABUSE', '86400'); - $hourlyUsageStatsRetention = (int) App::getEnv('_APP_MAINTENANCE_RETENTION_HOURLY_USAGE', '8640000'); //100 days + $usageStatsRetentionHourly = (int) App::getEnv('_APP_MAINTENANCE_RETENTION_USAGE_HOURLY', '8640000'); //100 days $cacheRetention = (int) App::getEnv('_APP_MAINTENANCE_RETENTION_CACHE', '2592000'); // 30 days - Console::loop(function () use ($interval, $executionLogsRetention, $abuseLogsRetention, $auditLogRetention, $hourlyUsageStatsRetention, $cacheRetention) { + Console::loop(function () use ($interval, $executionLogsRetention, $abuseLogsRetention, $auditLogRetention, $usageStatsRetentionHourly, $cacheRetention) { $database = getConsoleDB(); $time = DateTime::now(); @@ -156,7 +156,7 @@ $cli notifyDeleteExecutionLogs($executionLogsRetention); notifyDeleteAbuseLogs($abuseLogsRetention); notifyDeleteAuditLogs($auditLogRetention); - notifyDeleteUsageStats($hourlyUsageStatsRetention); + notifyDeleteUsageStats($usageStatsRetentionHourly); notifyDeleteConnections(); notifyDeleteExpiredSessions(); renewCertificates($database); diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index e180cfccb..e14e434a8 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -150,7 +150,7 @@ services: - _APP_MAINTENANCE_RETENTION_CACHE - _APP_MAINTENANCE_RETENTION_ABUSE - _APP_MAINTENANCE_RETENTION_AUDIT - - _APP_MAINTENANCE_RETENTION_HOURLY_USAGE + - _APP_MAINTENANCE_RETENTION_USAGE_HOURLY - _APP_SMS_PROVIDER - _APP_SMS_FROM @@ -550,7 +550,7 @@ services: - _APP_MAINTENANCE_RETENTION_CACHE - _APP_MAINTENANCE_RETENTION_ABUSE - _APP_MAINTENANCE_RETENTION_AUDIT - - _APP_MAINTENANCE_RETENTION_HOURLY_USAGE + - _APP_MAINTENANCE_RETENTION_USAGE_HOURLY appwrite-usage: image: /: diff --git a/docker-compose.yml b/docker-compose.yml index 25b455c36..18ea38f65 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -171,7 +171,7 @@ services: - _APP_MAINTENANCE_RETENTION_CACHE - _APP_MAINTENANCE_RETENTION_ABUSE - _APP_MAINTENANCE_RETENTION_AUDIT - - _APP_MAINTENANCE_RETENTION_HOURLY_USAGE + - _APP_MAINTENANCE_RETENTION_USAGE_HOURLY - _APP_SMS_PROVIDER - _APP_SMS_FROM @@ -603,7 +603,7 @@ services: - _APP_MAINTENANCE_RETENTION_CACHE - _APP_MAINTENANCE_RETENTION_ABUSE - _APP_MAINTENANCE_RETENTION_AUDIT - - _APP_MAINTENANCE_RETENTION_HOURLY_USAGE + - _APP_MAINTENANCE_RETENTION_USAGE_HOURLY appwrite-usage: entrypoint: usage diff --git a/src/Appwrite/Event/Delete.php b/src/Appwrite/Event/Delete.php index 90a77d489..d1519121a 100644 --- a/src/Appwrite/Event/Delete.php +++ b/src/Appwrite/Event/Delete.php @@ -60,7 +60,7 @@ class Delete extends Event * @param string $datetime * @return self */ - public function setHourlyUsageRetentionDatetime(string $datetime): self + public function setUsageRetentionHourlyDateTime(string $datetime): self { $this->hourlyUsageRetentionDatetime = $datetime; return $this;