diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index bb9408e692..db4fd9ede7 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -715,6 +715,17 @@ App::shutdown() ->trigger(); } + /** + * Update project last activity + */ + if (!$project->isEmpty() && $project->getId() !== 'console') { + $accessedAt = $project->getAttribute('accessedAt', ''); + if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_PROJECT_ACCESS)) > $accessedAt) { + $project->setAttribute('accessedAt', DateTime::now()); + Authorization::skip(fn () => $dbForConsole->updateDocument('projects', $project->getId(), $project)); + } + } + /** * Update user last activity */ diff --git a/app/init.php b/app/init.php index ea8b087faa..d3fb21e7ab 100644 --- a/app/init.php +++ b/app/init.php @@ -111,6 +111,7 @@ const APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT = 60; // Default maximum write rate pe const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return in list API calls const APP_KEY_ACCCESS = 24 * 60 * 60; // 24 hours const APP_USER_ACCCESS = 24 * 60 * 60; // 24 hours +const APP_PROJECT_ACCESS = 24 * 60 * 60; // 24 hours const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours const APP_CACHE_BUSTER = 4314; const APP_VERSION_STABLE = '1.5.7';