Rename to prevent collisions
This commit is contained in:
parent
656471ced2
commit
79b1fceaf3
5 changed files with 28 additions and 28 deletions
|
@ -287,7 +287,7 @@ App::get('/v1/database/usage')
|
||||||
|
|
||||||
$usage = [];
|
$usage = [];
|
||||||
if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
|
if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
|
||||||
$period = [
|
$periods = [
|
||||||
'24h' => [
|
'24h' => [
|
||||||
'period' => '30m',
|
'period' => '30m',
|
||||||
'limit' => 48,
|
'limit' => 48,
|
||||||
|
@ -321,10 +321,10 @@ App::get('/v1/database/usage')
|
||||||
|
|
||||||
$stats = [];
|
$stats = [];
|
||||||
|
|
||||||
Authorization::skip(function() use ($dbForInternal, $period, $range, $metrics, &$stats) {
|
Authorization::skip(function() use ($dbForInternal, $periods, $range, $metrics, &$stats) {
|
||||||
foreach ($metrics as $metric) {
|
foreach ($metrics as $metric) {
|
||||||
$limit = $period[$range]['limit'];
|
$limit = $periods[$range]['limit'];
|
||||||
$period = $period[$range]['period'];
|
$period = $periods[$range]['period'];
|
||||||
|
|
||||||
$requestDocs = $dbForInternal->find('stats', [
|
$requestDocs = $dbForInternal->find('stats', [
|
||||||
new Query('period', Query::TYPE_EQUAL, [$period]),
|
new Query('period', Query::TYPE_EQUAL, [$period]),
|
||||||
|
@ -404,7 +404,7 @@ App::get('/v1/database/:collectionId/usage')
|
||||||
|
|
||||||
$usage = [];
|
$usage = [];
|
||||||
if(App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
|
if(App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
|
||||||
$period = [
|
$periods = [
|
||||||
'24h' => [
|
'24h' => [
|
||||||
'period' => '30m',
|
'period' => '30m',
|
||||||
'limit' => 48,
|
'limit' => 48,
|
||||||
|
@ -433,10 +433,10 @@ App::get('/v1/database/:collectionId/usage')
|
||||||
|
|
||||||
$stats = [];
|
$stats = [];
|
||||||
|
|
||||||
Authorization::skip(function() use ($dbForInternal, $period, $range, $metrics, &$stats) {
|
Authorization::skip(function() use ($dbForInternal, $periods, $range, $metrics, &$stats) {
|
||||||
foreach ($metrics as $metric) {
|
foreach ($metrics as $metric) {
|
||||||
$limit = $period[$range]['limit'];
|
$limit = $periods[$range]['limit'];
|
||||||
$period = $period[$range]['period'];
|
$period = $periods[$range]['period'];
|
||||||
|
|
||||||
$requestDocs = $dbForInternal->find('stats', [
|
$requestDocs = $dbForInternal->find('stats', [
|
||||||
new Query('period', Query::TYPE_EQUAL, [$period]),
|
new Query('period', Query::TYPE_EQUAL, [$period]),
|
||||||
|
|
|
@ -176,7 +176,7 @@ App::get('/v1/functions/:functionId/usage')
|
||||||
|
|
||||||
$usage = [];
|
$usage = [];
|
||||||
if(App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
|
if(App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
|
||||||
$period = [
|
$periods = [
|
||||||
'24h' => [
|
'24h' => [
|
||||||
'period' => '30m',
|
'period' => '30m',
|
||||||
'limit' => 48,
|
'limit' => 48,
|
||||||
|
@ -203,10 +203,10 @@ App::get('/v1/functions/:functionId/usage')
|
||||||
|
|
||||||
$stats = [];
|
$stats = [];
|
||||||
|
|
||||||
Authorization::skip(function() use ($dbForInternal, $period, $range, $metrics, &$stats) {
|
Authorization::skip(function() use ($dbForInternal, $periods, $range, $metrics, &$stats) {
|
||||||
foreach ($metrics as $metric) {
|
foreach ($metrics as $metric) {
|
||||||
$limit = $period[$range]['limit'];
|
$limit = $periods[$range]['limit'];
|
||||||
$period = $period[$range]['period'];
|
$period = $periods[$range]['period'];
|
||||||
|
|
||||||
$requestDocs = $dbForInternal->find('stats', [
|
$requestDocs = $dbForInternal->find('stats', [
|
||||||
new Query('period', Query::TYPE_EQUAL, [$period]),
|
new Query('period', Query::TYPE_EQUAL, [$period]),
|
||||||
|
|
|
@ -255,7 +255,7 @@ App::get('/v1/projects/:projectId/usage')
|
||||||
|
|
||||||
$usage = [];
|
$usage = [];
|
||||||
if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
|
if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
|
||||||
$period = [
|
$periods = [
|
||||||
'24h' => [
|
'24h' => [
|
||||||
'period' => '30m',
|
'period' => '30m',
|
||||||
'limit' => 48,
|
'limit' => 48,
|
||||||
|
@ -288,10 +288,10 @@ App::get('/v1/projects/:projectId/usage')
|
||||||
|
|
||||||
$stats = [];
|
$stats = [];
|
||||||
|
|
||||||
Authorization::skip(function() use ($dbForInternal, $period, $range, $metrics, &$stats) {
|
Authorization::skip(function() use ($dbForInternal, $periods, $range, $metrics, &$stats) {
|
||||||
foreach ($metrics as $metric) {
|
foreach ($metrics as $metric) {
|
||||||
$limit = $period[$range]['limit'];
|
$limit = $periods[$range]['limit'];
|
||||||
$period = $period[$range]['period'];
|
$period = $periods[$range]['period'];
|
||||||
|
|
||||||
$requestDocs = $dbForInternal->find('stats', [
|
$requestDocs = $dbForInternal->find('stats', [
|
||||||
new Query('period', Query::TYPE_EQUAL, [$period]),
|
new Query('period', Query::TYPE_EQUAL, [$period]),
|
||||||
|
|
|
@ -670,7 +670,7 @@ App::get('/v1/storage/usage')
|
||||||
|
|
||||||
$usage = [];
|
$usage = [];
|
||||||
if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
|
if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
|
||||||
$period = [
|
$periods = [
|
||||||
'24h' => [
|
'24h' => [
|
||||||
'period' => '30m',
|
'period' => '30m',
|
||||||
'limit' => 48,
|
'limit' => 48,
|
||||||
|
@ -696,10 +696,10 @@ App::get('/v1/storage/usage')
|
||||||
|
|
||||||
$stats = [];
|
$stats = [];
|
||||||
|
|
||||||
Authorization::skip(function() use ($dbForInternal, $period, $range, $metrics, &$stats) {
|
Authorization::skip(function() use ($dbForInternal, $periods, $range, $metrics, &$stats) {
|
||||||
foreach ($metrics as $metric) {
|
foreach ($metrics as $metric) {
|
||||||
$limit = $period[$range]['limit'];
|
$limit = $periods[$range]['limit'];
|
||||||
$period = $period[$range]['period'];
|
$period = $periods[$range]['period'];
|
||||||
|
|
||||||
$requestDocs = $dbForInternal->find('stats', [
|
$requestDocs = $dbForInternal->find('stats', [
|
||||||
new Query('period', Query::TYPE_EQUAL, [$period]),
|
new Query('period', Query::TYPE_EQUAL, [$period]),
|
||||||
|
@ -764,7 +764,7 @@ App::get('/v1/storage/:bucketId/usage')
|
||||||
|
|
||||||
$usage = [];
|
$usage = [];
|
||||||
if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
|
if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
|
||||||
$period = [
|
$periods = [
|
||||||
'24h' => [
|
'24h' => [
|
||||||
'period' => '30m',
|
'period' => '30m',
|
||||||
'limit' => 48,
|
'limit' => 48,
|
||||||
|
@ -793,10 +793,10 @@ App::get('/v1/storage/:bucketId/usage')
|
||||||
|
|
||||||
$stats = [];
|
$stats = [];
|
||||||
|
|
||||||
Authorization::skip(function() use ($dbForInternal, $period, $range, $metrics, &$stats) {
|
Authorization::skip(function() use ($dbForInternal, $periods, $range, $metrics, &$stats) {
|
||||||
foreach ($metrics as $metric) {
|
foreach ($metrics as $metric) {
|
||||||
$limit = $period[$range]['limit'];
|
$limit = $periods[$range]['limit'];
|
||||||
$period = $period[$range]['period'];
|
$period = $periods[$range]['period'];
|
||||||
|
|
||||||
$requestDocs = $dbForInternal->find('stats', [
|
$requestDocs = $dbForInternal->find('stats', [
|
||||||
new Query('period', Query::TYPE_EQUAL, [$period]),
|
new Query('period', Query::TYPE_EQUAL, [$period]),
|
||||||
|
|
|
@ -780,7 +780,7 @@ App::get('/v1/users/usage')
|
||||||
|
|
||||||
$usage = [];
|
$usage = [];
|
||||||
if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
|
if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
|
||||||
$period = [
|
$periods = [
|
||||||
'24h' => [
|
'24h' => [
|
||||||
'period' => '30m',
|
'period' => '30m',
|
||||||
'limit' => 48,
|
'limit' => 48,
|
||||||
|
@ -812,10 +812,10 @@ App::get('/v1/users/usage')
|
||||||
|
|
||||||
$stats = [];
|
$stats = [];
|
||||||
|
|
||||||
Authorization::skip(function() use ($dbForInternal, $period, $range, $metrics, &$stats) {
|
Authorization::skip(function() use ($dbForInternal, $periods, $range, $metrics, &$stats) {
|
||||||
foreach ($metrics as $metric) {
|
foreach ($metrics as $metric) {
|
||||||
$limit = $period[$range]['limit'];
|
$limit = $periods[$range]['limit'];
|
||||||
$period = $period[$range]['period'];
|
$period = $periods[$range]['period'];
|
||||||
|
|
||||||
$requestDocs = $dbForInternal->find('stats', [
|
$requestDocs = $dbForInternal->find('stats', [
|
||||||
new Query('period', Query::TYPE_EQUAL, [$period]),
|
new Query('period', Query::TYPE_EQUAL, [$period]),
|
||||||
|
|
Loading…
Reference in a new issue