1
0
Fork 0
mirror of synced 2024-06-27 02:31:04 +12:00

logger moved to App::shutdown

This commit is contained in:
shimon 2022-07-09 21:24:28 +03:00
parent 9968bebed2
commit 59627ea9ef
7 changed files with 27 additions and 10 deletions

View file

@ -68,6 +68,9 @@ $avatarCallback = function (string $type, string $code, int $width, int $height,
$data = $image->output($output, $quality);
App::setResource('cacheKey', fn () => $key);
App::setResource('cachePath', fn () => 'app-0');
$cache->save($key, $data);
$response
@ -191,6 +194,9 @@ App::get('/v1/avatars/image')
$data = $image->output($output, $quality);
App::setResource('cacheKey', fn () => $key);
App::setResource('cachePath', fn () => 'app-0');
$cache->save($key, $data);
$response
@ -321,6 +327,9 @@ App::get('/v1/avatars/favicon')
throw new Exception('Favicon not found', 404, Exception::AVATAR_ICON_NOT_FOUND);
}
App::setResource('cacheKey', fn () => $key);
App::setResource('cachePath', fn () => 'app-0');
$cache->save($key, $data);
return $response
@ -344,6 +353,9 @@ App::get('/v1/avatars/favicon')
$data = $image->output($output, $quality);
App::setResource('cacheKey', fn () => $key);
App::setResource('cachePath', fn () => 'app-0');
$cache->save($key, $data);
$response

View file

@ -970,6 +970,10 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
$cache->save($key, $data);
App::setResource('cacheKey', fn () => $key);
App::setResource('cachePath', fn () => 'app-' . $project->getId());
$usage
->setParam('storage.files.read', 1)
->setParam('bucketId', $bucketId)

View file

@ -237,7 +237,6 @@ App::shutdown(function (App $utopia, Request $request, Response $response, Docum
$database->trigger();
}
$route = $utopia->match($request);
if (
App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled'

View file

@ -86,8 +86,8 @@ const APP_LIMIT_COMPRESSION = 20000000; //20MB
const APP_LIMIT_ARRAY_PARAMS_SIZE = 100; // Default maximum of how many elements can there be in API parameter that expects array value
const APP_LIMIT_ARRAY_ELEMENT_SIZE = 4096; // Default maximum length of element in array parameter represented by maximum URL length.
const APP_LIMIT_SUBQUERY = 1000;
const APP_CACHE_BUSTER = 402;
const APP_VERSION_STABLE = '0.15.2';
const APP_CACHE_BUSTER = 400;
const APP_VERSION_STABLE = '0.15.0';
const APP_DATABASE_ATTRIBUTE_EMAIL = 'email';
const APP_DATABASE_ATTRIBUTE_ENUM = 'enum';
const APP_DATABASE_ATTRIBUTE_IP = 'ip';
@ -695,6 +695,8 @@ App::setResource('layout', function ($locale) {
return $layout;
}, ['locale']);
App::setResource('cacheKey', fn () => '');
App::setResource('cachePath', fn () => '');
App::setResource('locale', fn() => new Locale(App::getEnv('_APP_LOCALE', 'en')));
// Queues

View file

@ -149,7 +149,7 @@ class DeletesV1 extends Worker
if ($cache->delete($path)) {
Console::success('Deleting cache file: ' . $path);
} else {
Console::error('**Failed to delete cache file: ' . $path);
Console::error('Failed to delete cache file: ' . $path);
}
}
);

10
composer.lock generated
View file

@ -236,16 +236,16 @@
},
{
"name": "chillerlan/php-settings-container",
"version": "2.1.3",
"version": "2.1.4",
"source": {
"type": "git",
"url": "https://github.com/chillerlan/php-settings-container.git",
"reference": "125dd573b45ffc7cabecf385986a356ba2c6f602"
"reference": "1beb7df3c14346d4344b0b2e12f6f9a74feabd4a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/chillerlan/php-settings-container/zipball/125dd573b45ffc7cabecf385986a356ba2c6f602",
"reference": "125dd573b45ffc7cabecf385986a356ba2c6f602",
"url": "https://api.github.com/repos/chillerlan/php-settings-container/zipball/1beb7df3c14346d4344b0b2e12f6f9a74feabd4a",
"reference": "1beb7df3c14346d4344b0b2e12f6f9a74feabd4a",
"shasum": ""
},
"require": {
@ -296,7 +296,7 @@
"type": "ko_fi"
}
],
"time": "2022-03-09T13:18:58+00:00"
"time": "2022-07-05T22:32:14+00:00"
},
{
"name": "colinmollenhour/credis",

View file

@ -208,7 +208,7 @@ services:
volumes:
- ./app:/usr/src/code/app
- ./src:/usr/src/code/src
# - ./vendor:/usr/src/code/vendor
- ./vendor:/usr/src/code/vendor
depends_on:
- mariadb
- redis