|
|
@@ -244,14 +244,11 @@ class WalletService extends BaseService
|
|
|
}
|
|
|
|
|
|
$cacheKey = "caches:wallet:balance:sol_usdt_{$address}";
|
|
|
- if ($data = RedisService::get($cacheKey) && $cache) {
|
|
|
+ $data = RedisService::get($cacheKey);
|
|
|
+ if ($data && !$cache) {
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
|
- if (RedisService::get($cacheKey . '_lock') && $cache) {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
try {
|
|
|
$apiUrl = ConfigService::make()->getConfigByCode('solana_scan_api', '');
|
|
|
if (empty($apiUrl)) {
|
|
|
@@ -286,8 +283,7 @@ class WalletService extends BaseService
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- RedisService::set($cacheKey, ['amount'=> $balance,'tokenAccount'=>$tokenAccount], rand(3, 5));
|
|
|
- RedisService::set($cacheKey . '_lock', true, rand(3, 5));
|
|
|
+ RedisService::set($cacheKey, ['amount'=> $balance,'tokenAccount'=>$tokenAccount], rand(5, 10));
|
|
|
return ['amount'=> $balance,'tokenAccount'=>$tokenAccount];
|
|
|
|
|
|
} catch (\Exception $exception) {
|