From 16fe23244b4b1d726751daa425cda6a22078ec84 Mon Sep 17 00:00:00 2001 From: shimon Date: Wed, 9 Oct 2024 20:13:28 +0300 Subject: [PATCH] builds metric reduce --- app/controllers/shared/api.php | 8 +++++- composer.lock | 48 +++++++++++++++++----------------- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index c5e4f516d6..9631d9b09d 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -469,7 +469,6 @@ App::init() ); $timestamp = 60 * 60 * 24 * 30; $data = $cache->load($key, $timestamp); - if (!empty($data) && !$cacheLog->isEmpty()) { $parts = explode('/', $cacheLog->getAttribute('resourceType')); $type = $parts[0] ?? null; @@ -712,9 +711,13 @@ App::shutdown() * Cache label */ $useCache = $route->getLabel('cache', false); + var_dump('$useCache='); + var_dump($useCache); if ($useCache) { $resource = $resourceType = null; $data = $response->getPayload(); + var_dump('!empty($data[payload]='); + var_dump(!empty($data['payload'])); if (!empty($data['payload'])) { $pattern = $route->getLabel('cache.resource', null); if (!empty($pattern)) { @@ -731,7 +734,10 @@ App::shutdown() $cacheLog = Authorization::skip(fn () => $dbForProject->getDocument('cache', $key)); $accessedAt = $cacheLog->getAttribute('accessedAt', ''); $now = DateTime::now(); + var_dump('$cacheLog='); + var_dump($cacheLog); if ($cacheLog->isEmpty()) { + var_dump('inserting.....'); Authorization::skip(fn () => $dbForProject->createDocument('cache', new Document([ '$id' => $key, 'resource' => $resource, diff --git a/composer.lock b/composer.lock index 275fd9dbb9..c7ef692624 100644 --- a/composer.lock +++ b/composer.lock @@ -2124,16 +2124,16 @@ }, { "name": "utopia-php/messaging", - "version": "0.12.0", + "version": "0.12.1", "source": { "type": "git", "url": "https://github.com/utopia-php/messaging.git", - "reference": "6e466d3511981291843c6ebf9ce3f44fc75e37b0" + "reference": "b9dfafb5efc1d12cbee01d03dc98853ef026e35b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/messaging/zipball/6e466d3511981291843c6ebf9ce3f44fc75e37b0", - "reference": "6e466d3511981291843c6ebf9ce3f44fc75e37b0", + "url": "https://api.github.com/repos/utopia-php/messaging/zipball/b9dfafb5efc1d12cbee01d03dc98853ef026e35b", + "reference": "b9dfafb5efc1d12cbee01d03dc98853ef026e35b", "shasum": "" }, "require": { @@ -2169,22 +2169,22 @@ ], "support": { "issues": "https://github.com/utopia-php/messaging/issues", - "source": "https://github.com/utopia-php/messaging/tree/0.12.0" + "source": "https://github.com/utopia-php/messaging/tree/0.12.1" }, - "time": "2024-05-30T14:58:25+00:00" + "time": "2024-10-09T08:17:07+00:00" }, { "name": "utopia-php/migration", - "version": "0.6.4", + "version": "0.6.7", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "e43ef283f1386084e11d1ffe093fb6c6d7a6ce6c" + "reference": "9f2d1afc2acf2b6cdc5088ad4becbab131df0f2a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/e43ef283f1386084e11d1ffe093fb6c6d7a6ce6c", - "reference": "e43ef283f1386084e11d1ffe093fb6c6d7a6ce6c", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/9f2d1afc2acf2b6cdc5088ad4becbab131df0f2a", + "reference": "9f2d1afc2acf2b6cdc5088ad4becbab131df0f2a", "shasum": "" }, "require": { @@ -2225,9 +2225,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.6.4" + "source": "https://github.com/utopia-php/migration/tree/0.6.7" }, - "time": "2024-10-02T15:16:36+00:00" + "time": "2024-10-09T10:21:25+00:00" }, { "name": "utopia-php/mongo", @@ -3002,16 +3002,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.39.22", + "version": "0.39.23", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "bdbb1607527550e67283ff0533522d1410c2c0df" + "reference": "0acceabb7593c9c07c5db85a84a5ebac60896763" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/bdbb1607527550e67283ff0533522d1410c2c0df", - "reference": "bdbb1607527550e67283ff0533522d1410c2c0df", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/0acceabb7593c9c07c5db85a84a5ebac60896763", + "reference": "0acceabb7593c9c07c5db85a84a5ebac60896763", "shasum": "" }, "require": { @@ -3047,9 +3047,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.39.22" + "source": "https://github.com/appwrite/sdk-generator/tree/0.39.23" }, - "time": "2024-10-01T16:16:26+00:00" + "time": "2024-10-08T00:38:57+00:00" }, { "name": "doctrine/annotations", @@ -3573,16 +3573,16 @@ }, { "name": "nikic/php-parser", - "version": "v5.3.0", + "version": "v5.3.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "3abf7425cd284141dc5d8d14a9ee444de3345d1a" + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/3abf7425cd284141dc5d8d14a9ee444de3345d1a", - "reference": "3abf7425cd284141dc5d8d14a9ee444de3345d1a", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", "shasum": "" }, "require": { @@ -3625,9 +3625,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" }, - "time": "2024-09-29T13:56:26+00:00" + "time": "2024-10-08T18:51:32+00:00" }, { "name": "phar-io/manifest",