From b4b28a9cf41b943b0da940bf8a4750b753fea333 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 11 Jun 2025 18:36:51 +0400 Subject: [PATCH] fix: project iteration loop --- src/Appwrite/Platform/Tasks/Maintenance.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Appwrite/Platform/Tasks/Maintenance.php b/src/Appwrite/Platform/Tasks/Maintenance.php index 47f9262006..ddc8c3cb6f 100644 --- a/src/Appwrite/Platform/Tasks/Maintenance.php +++ b/src/Appwrite/Platform/Tasks/Maintenance.php @@ -64,9 +64,9 @@ class Maintenance extends Action Console::info("[{$time}] Notifying workers with maintenance tasks every {$interval} seconds"); - // Iterate through project only if it was accessed in last 24 hours - $dateInterval = DateInterval::createFromDateString('24 hours'); - $before24h = (new DateTime())->sub($dateInterval); + // Iterate through project only if it was accessed in last 30 days + $dateInterval = DateInterval::createFromDateString('30 days'); + $before30days = (new DateTime())->sub($dateInterval); $dbForPlatform->foreach( 'projects', @@ -80,7 +80,7 @@ class Maintenance extends Action [ Query::equal('region', [System::getEnv('_APP_REGION', 'default')]), Query::limit(100), - Query::greaterThanEqual('accessedAt', DatabaseDateTime::format($before24h)), + Query::greaterThanEqual('accessedAt', DatabaseDateTime::format($before30days)), Query::orderAsc('teamInternalId'), ] );