aliyun / aliyun-openapi-php-sdk

[Abandoned] Open API SDK for PHP developers
Other
606 stars 806 forks source link

LocationService::checkCacheIsExpire 报错! #69

Closed wskeee closed 5 years ago

wskeee commented 6 years ago

在多次调用 $client->getAcsResponse($request); 后会报 image

初步确定原因是LocationService第一次调用findProductDomain,时创建了 @$domain = self::$cache[$key]; 但没有添加self::$lastClearTimePerProduct[$key] = $lastClearTime; 导致第二次调用findProductDomain时缺少self::$lastClearTimePerProduct[$key]

作以下改动后可以正常,但不知这种做会带来什么负面影响。

`public function findProductDomain($regionId, $serviceCode, $endPointType, $product) { $key = $regionId . '#' . $product; @$domain = self::$cache[$key]; if ($domain == null || $this->checkCacheIsExpire($key) == true) { $domain = $this->findProductDomainFromLocationService($regionId, $serviceCode, $endPointType); self::$cache[$key] = $domain; //wskeee //$lastClearTime = mktime(0, 0, 0, 1, 1, 2999); //self::$lastClearTimePerProduct[$key] = $lastClearTime; }

    return $domain;
}

` (PS:前面已经有人提出 https://github.com/aliyun/aliyun-openapi-php-sdk/issues/43 这个bug,但回复解决办法居然是叫设置忽略PHP的note警告!!!)

AxiosLeo commented 6 years ago

@wskeee 要不MTS服务试试我这个SDK吧

https://github.com/AxiosCros/aliyun-sdk

有什么问题的话,我会及时解决的。

zzwooc commented 6 years ago

我的mts服务也会经常报location,region相关的错误