mirror of
https://github.com/elyby/accounts.git
synced 2024-12-27 23:50:19 +05:30
Hotfix to handle Chrly's long responses
This commit is contained in:
parent
0dc8ca8c78
commit
db8e13d749
@ -65,12 +65,22 @@ class Textures {
|
||||
public function getTextures(): array {
|
||||
/** @var SkinSystemApi $api */
|
||||
$api = Yii::$container->get(SkinSystemApi::class);
|
||||
if (YII_ENV_PROD) {
|
||||
$api->setClient(new \GuzzleHttp\Client([
|
||||
'connect_timeout' => 2,
|
||||
'decode_content' => false,
|
||||
'read_timeout' => 5,
|
||||
'stream' => true,
|
||||
'timeout' => 5,
|
||||
]));
|
||||
}
|
||||
|
||||
try {
|
||||
$textures = $api->textures($this->account->username);
|
||||
} catch (RequestException $e) {
|
||||
Yii::warning('Cannot get textures from skinsystem.ely.by. Exception message is ' . $e->getMessage());
|
||||
} catch (GuzzleException $e) {
|
||||
Yii::error($e);
|
||||
Yii::warning($e);
|
||||
}
|
||||
|
||||
return $textures ?? [];
|
||||
|
Loading…
Reference in New Issue
Block a user