fix: workers
This commit is contained in:
parent
e148617d3e
commit
62e459c581
4 changed files with 7 additions and 3 deletions
|
@ -1107,7 +1107,6 @@ App::post('/v1/account/tokens/magic-url')
|
|||
|
||||
$message = Template::fromFile(__DIR__ . '/../../config/locale/templates/email-magic-url.tpl');
|
||||
$message
|
||||
->setParam('{{body}}', $body, escapeHtml: false)
|
||||
->setParam('{{hello}}', $locale->getText("emails.magicSession.hello"))
|
||||
->setParam('{{optionButton}}', $locale->getText("emails.magicSession.optionButton"))
|
||||
->setParam('{{buttonText}}', $locale->getText("emails.magicSession.buttonText"))
|
||||
|
|
|
@ -11,6 +11,7 @@ use Appwrite\Event\Delete;
|
|||
use Appwrite\Event\Func;
|
||||
use Appwrite\Event\Hamster;
|
||||
use Appwrite\Event\Mail;
|
||||
use Appwrite\Event\Messaging;
|
||||
use Appwrite\Event\Migration;
|
||||
use Appwrite\Event\Phone;
|
||||
use Appwrite\Event\Usage;
|
||||
|
|
|
@ -539,13 +539,13 @@ class Builds extends Action
|
|||
|
||||
/** Trigger usage queue */
|
||||
$queueForUsage
|
||||
->setProject($project)
|
||||
->addMetric(METRIC_BUILDS, 1) // per project
|
||||
->addMetric(METRIC_BUILDS_STORAGE, $build->getAttribute('size', 0))
|
||||
->addMetric(METRIC_BUILDS_COMPUTE, (int)$build->getAttribute('duration', 0) * 1000)
|
||||
->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_BUILDS), 1) // per function
|
||||
->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_BUILDS_STORAGE), $build->getAttribute('size', 0))
|
||||
->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_BUILDS_COMPUTE), (int)$build->getAttribute('duration', 0) * 1000)
|
||||
->setProject($project)
|
||||
->trigger();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ use Utopia\Database\Exception\Structure;
|
|||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Query;
|
||||
use Utopia\Domains\Domain;
|
||||
use Utopia\Locale\Locale;
|
||||
use Utopia\Logger\Log;
|
||||
use Utopia\Platform\Action;
|
||||
use Utopia\Queue\Message;
|
||||
|
@ -423,6 +424,8 @@ class Certificates extends Action
|
|||
// Log error into console
|
||||
Console::warning('Cannot renew domain (' . $domain . ') on attempt no. ' . $attempt . ' certificate: ' . $errorMessage);
|
||||
|
||||
$locale = new Locale(App::getEnv('_APP_LOCALE', 'en'));
|
||||
|
||||
// Send mail to administratore mail
|
||||
$template = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-certificate-failed.tpl');
|
||||
$template->setParam('{{domain}}', $domain);
|
||||
|
@ -455,8 +458,9 @@ class Certificates extends Action
|
|||
|
||||
$queueForMails
|
||||
->setSubject($subject)
|
||||
->setBody($body->render())
|
||||
->setBody($body)
|
||||
->setName('Appwrite Administrator')
|
||||
->setVariables($emailVariables)
|
||||
->setRecipient(App::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS'))
|
||||
->trigger();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue