mirror of
https://github.com/appwrite/appwrite
synced 2026-05-14 12:38:31 +00:00
parent
650627bfb4
commit
9dff192508
2 changed files with 17 additions and 24 deletions
28
composer.lock
generated
28
composer.lock
generated
|
|
@ -3705,16 +3705,16 @@
|
|||
},
|
||||
{
|
||||
"name": "utopia-php/database",
|
||||
"version": "0.61.2",
|
||||
"version": "0.61.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/database.git",
|
||||
"reference": "349fbdf4bc088f7775c7dfb8b80239a617a88436"
|
||||
"reference": "2e0165bd14a570ec151f400ed381108e81d15b94"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/database/zipball/349fbdf4bc088f7775c7dfb8b80239a617a88436",
|
||||
"reference": "349fbdf4bc088f7775c7dfb8b80239a617a88436",
|
||||
"url": "https://api.github.com/repos/utopia-php/database/zipball/2e0165bd14a570ec151f400ed381108e81d15b94",
|
||||
"reference": "2e0165bd14a570ec151f400ed381108e81d15b94",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -3755,9 +3755,9 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/utopia-php/database/issues",
|
||||
"source": "https://github.com/utopia-php/database/tree/0.61.2"
|
||||
"source": "https://github.com/utopia-php/database/tree/0.61.1"
|
||||
},
|
||||
"time": "2025-03-15T11:47:42+00:00"
|
||||
"time": "2025-03-14T01:19:38+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/domains",
|
||||
|
|
@ -5317,16 +5317,16 @@
|
|||
},
|
||||
{
|
||||
"name": "laravel/pint",
|
||||
"version": "v1.21.2",
|
||||
"version": "v1.21.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/pint.git",
|
||||
"reference": "370772e7d9e9da087678a0edf2b11b6960e40558"
|
||||
"reference": "c44bffbb2334e90fba560933c45948fa4a3f3e86"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/pint/zipball/370772e7d9e9da087678a0edf2b11b6960e40558",
|
||||
"reference": "370772e7d9e9da087678a0edf2b11b6960e40558",
|
||||
"url": "https://api.github.com/repos/laravel/pint/zipball/c44bffbb2334e90fba560933c45948fa4a3f3e86",
|
||||
"reference": "c44bffbb2334e90fba560933c45948fa4a3f3e86",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -5337,9 +5337,9 @@
|
|||
"php": "^8.2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "^3.72.0",
|
||||
"illuminate/view": "^11.44.2",
|
||||
"larastan/larastan": "^3.2.0",
|
||||
"friendsofphp/php-cs-fixer": "^3.70.2",
|
||||
"illuminate/view": "^11.44.1",
|
||||
"larastan/larastan": "^3.1.0",
|
||||
"laravel-zero/framework": "^11.36.1",
|
||||
"mockery/mockery": "^1.6.12",
|
||||
"nunomaduro/termwind": "^2.3",
|
||||
|
|
@ -5379,7 +5379,7 @@
|
|||
"issues": "https://github.com/laravel/pint/issues",
|
||||
"source": "https://github.com/laravel/pint"
|
||||
},
|
||||
"time": "2025-03-14T22:31:42+00:00"
|
||||
"time": "2025-03-11T03:22:21+00:00"
|
||||
},
|
||||
{
|
||||
"name": "matthiasmullie/minify",
|
||||
|
|
|
|||
|
|
@ -387,8 +387,7 @@ class Deletes extends Action
|
|||
|
||||
$query = [
|
||||
Query::lessThan('accessedAt', $datetime),
|
||||
Query::orderDesc('accessedAt'),
|
||||
Query::orderDesc('$internalId'),
|
||||
Query::orderDesc('accessedAt')
|
||||
];
|
||||
|
||||
$this->deleteByGroup(
|
||||
|
|
@ -416,26 +415,24 @@ class Deletes extends Action
|
|||
*/
|
||||
private function deleteUsageStats(Document $project, callable $getProjectDB, callable $getLogsDB, string $hourlyUsageRetentionDatetime): void
|
||||
{
|
||||
/** @var Database $dbForProject*/
|
||||
/** @var \Utopia\Database\Database $dbForProject*/
|
||||
$dbForProject = $getProjectDB($project);
|
||||
|
||||
// Delete Usage stats from projectDB
|
||||
$this->deleteByGroup('stats', [
|
||||
Query::lessThan('time', $hourlyUsageRetentionDatetime),
|
||||
Query::orderDesc('time'),
|
||||
Query::orderDesc('$internalId'),
|
||||
Query::equal('period', ['1h']),
|
||||
], $dbForProject);
|
||||
|
||||
if ($project->getId() !== 'console') {
|
||||
/** @var Database $dbForLogs*/
|
||||
/** @var \Utopia\Database\Database $dbForLogs*/
|
||||
$dbForLogs = call_user_func($getLogsDB, $project);
|
||||
|
||||
// Delete Usage stats from logsDB
|
||||
$this->deleteByGroup('stats', [
|
||||
Query::lessThan('time', $hourlyUsageRetentionDatetime),
|
||||
Query::orderDesc('time'),
|
||||
Query::orderDesc('$internalId'),
|
||||
Query::equal('period', ['1h']),
|
||||
], $dbForLogs);
|
||||
}
|
||||
|
|
@ -699,7 +696,6 @@ class Deletes extends Action
|
|||
$this->deleteByGroup('executions', [
|
||||
Query::lessThan('$createdAt', $datetime),
|
||||
Query::orderDesc('$createdAt'),
|
||||
Query::orderDesc('$internalId'),
|
||||
], $dbForProject);
|
||||
}
|
||||
|
||||
|
|
@ -719,7 +715,6 @@ class Deletes extends Action
|
|||
$this->deleteByGroup('sessions', [
|
||||
Query::lessThan('$createdAt', $expired),
|
||||
Query::orderDesc('$createdAt'),
|
||||
Query::orderDesc('$internalId'),
|
||||
], $dbForProject);
|
||||
}
|
||||
|
||||
|
|
@ -735,7 +730,6 @@ class Deletes extends Action
|
|||
$this->deleteByGroup('realtime', [
|
||||
Query::lessThan('timestamp', $datetime),
|
||||
Query::orderDesc('timestamp'),
|
||||
Query::orderDesc('$internalId'),
|
||||
], $dbForPlatform);
|
||||
}
|
||||
|
||||
|
|
@ -755,7 +749,6 @@ class Deletes extends Action
|
|||
$this->deleteByGroup(Audit::COLLECTION, [
|
||||
Query::lessThan('time', $auditRetention),
|
||||
Query::orderDesc('time'),
|
||||
Query::orderDesc('$internalId'),
|
||||
], $dbForProject);
|
||||
} catch (DatabaseException $e) {
|
||||
Console::error('Failed to delete audit logs for project ' . $projectId . ': ' . $e->getMessage());
|
||||
|
|
|
|||
Loading…
Reference in a new issue