mirror of
https://github.com/elyby/accounts.git
synced 2024-11-30 02:32:26 +05:30
Фикс для очереди пула ников
This commit is contained in:
parent
7315ddc4ea
commit
f3b953607d
@ -78,7 +78,7 @@ class ChangeUsernameForm extends ApiForm {
|
||||
public function createEventTask($accountId, $newNickname, $oldNickname) {
|
||||
$model = new UsernameChanged;
|
||||
$model->accountId = $accountId;
|
||||
$model-> oldUsername = $oldNickname;
|
||||
$model->oldUsername = $oldNickname;
|
||||
$model->newUsername = $newNickname;
|
||||
|
||||
$message = Amqp::getInstance()->prepareMessage($model, [
|
||||
|
@ -14,7 +14,7 @@ class Api {
|
||||
*
|
||||
* @return UsernameToUUIDResponse
|
||||
* @throws MojangApiException
|
||||
* @throws NoContentException
|
||||
* @throws NoContentException|\GuzzleHttp\Exception\RequestException
|
||||
* @url http://wiki.vg/Mojang_API#Username_-.3E_UUID_at_time
|
||||
*/
|
||||
public function usernameToUUID($username, $atTime = null) {
|
||||
|
@ -7,6 +7,7 @@ use common\components\RabbitMQ\Component as RabbitMQComponent;
|
||||
use common\models\amqp\UsernameChanged;
|
||||
use common\models\MojangUsername;
|
||||
use console\controllers\base\AmqpController;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
|
||||
class AccountQueueController extends AmqpController {
|
||||
|
||||
@ -41,6 +42,8 @@ class AccountQueueController extends AmqpController {
|
||||
$response = $mojangApi->usernameToUUID($body->newUsername);
|
||||
} catch (NoContentException $e) {
|
||||
$response = false;
|
||||
} catch (RequestException $e) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** @var MojangUsername|null $mojangUsername */
|
||||
|
Loading…
Reference in New Issue
Block a user