mirror of
https://github.com/elyby/accounts.git
synced 2024-12-25 06:39:46 +05:30
Сбор метрик о работе воркера
This commit is contained in:
parent
6f7fcf9e44
commit
0fee23ac86
@ -32,11 +32,14 @@ class AccountQueueController extends AmqpController {
|
||||
}
|
||||
|
||||
public function routeUsernameChanged(UsernameChanged $body): bool {
|
||||
Yii::$app->statsd->inc('worker.account.usernameChanged.attempt');
|
||||
$mojangApi = $this->createMojangApi();
|
||||
try {
|
||||
$response = $mojangApi->usernameToUUID($body->newUsername);
|
||||
Yii::$app->statsd->inc('worker.account.usernameChanged.found');
|
||||
} catch (NoContentException $e) {
|
||||
$response = false;
|
||||
Yii::$app->statsd->inc('worker.account.usernameChanged.not_found');
|
||||
} catch (RequestException $e) {
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user