Фикс для очереди пула ников

This commit is contained in:
ErickSkrauch 2016-10-25 22:20:44 +03:00
parent 7315ddc4ea
commit f3b953607d
3 changed files with 5 additions and 2 deletions

View File

@ -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, [

View File

@ -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) {

View File

@ -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 */