1.优化中奖事件统一使用bet.win订阅中奖消息
This commit is contained in:
@@ -17,10 +17,12 @@ final class StreakWinReward
|
||||
|
||||
/** @var list<array{streak: int, odds_factor: int, is_jackpot: bool}>|null */
|
||||
private static ?array $cache = null;
|
||||
private static ?string $cacheConfigValue = null;
|
||||
|
||||
public static function clearCache(): void
|
||||
{
|
||||
self::$cache = null;
|
||||
self::$cacheConfigValue = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,11 +99,16 @@ final class StreakWinReward
|
||||
*/
|
||||
public static function loadRows(): array
|
||||
{
|
||||
if (self::$cache !== null) {
|
||||
$row = GameHotDataRedis::gameConfigRow(self::CONFIG_KEY);
|
||||
$rawValue = $row['config_value'] ?? null;
|
||||
$normalizedRaw = is_string($rawValue) ? trim($rawValue) : (is_numeric($rawValue) ? (string) $rawValue : '');
|
||||
|
||||
if (self::$cache !== null && self::$cacheConfigValue === $normalizedRaw) {
|
||||
return self::$cache;
|
||||
}
|
||||
$row = GameHotDataRedis::gameConfigRow(self::CONFIG_KEY);
|
||||
self::$cache = self::parseFromConfigValue($row['config_value'] ?? null);
|
||||
|
||||
self::$cache = self::parseFromConfigValue($normalizedRaw);
|
||||
self::$cacheConfigValue = $normalizedRaw;
|
||||
|
||||
return self::$cache;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user