1
0
Fork 0
mirror of synced 2024-05-20 12:42:39 +12:00

disable functions stats collection if usage stats disabled

This commit is contained in:
Damodar Lohani 2021-01-13 11:42:15 +05:45
parent f06e92436e
commit 1cbca0a6a6
3 changed files with 6 additions and 2 deletions

View file

@ -240,6 +240,7 @@ services:
- _APP_FUNCTIONS_CPUS
- _APP_FUNCTIONS_MEMORY
- _APP_FUNCTIONS_MEMORY_SWAP
- _APP_USAGE_STATS
appwrite-worker-mails:
image: appwrite/appwrite:<?php echo $version."\n"; ?>

View file

@ -470,8 +470,10 @@ class FunctionsV1
->setParam('networkRequestSize', 0)
->setParam('networkResponseSize', 0)
;
$usage->trigger();
$appUsageStatsEnabled = App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled';
if($appUsageStatsEnabled) {
$usage->trigger();
}
$this->cleanup();
}

View file

@ -293,6 +293,7 @@ services:
- _APP_FUNCTIONS_CPUS
- _APP_FUNCTIONS_MEMORY
- _APP_FUNCTIONS_MEMORY_SWAP
- _APP_USAGE_STATS
appwrite-worker-mails:
entrypoint: worker-mails