1.优化websocket中的jackpot.hit
This commit is contained in:
@@ -621,6 +621,26 @@ final class GameBetSettleService
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 兜底补偿:在派彩期内(status=3)允许周期性调用,确保 bet.win / jackpot.hit 最终可达。
|
||||
* - bet.win 由 dfw:v1:ws:betwin:{period_id}:{user_id} 去重
|
||||
* - jackpot.hit 由 dfw:v1:ws:jackpot_hit:{period_id} 去重
|
||||
* - user.streak / wallet.changed 仍受 dfw:v1:settle:notify:{period_id} 约束
|
||||
*/
|
||||
public static function ensurePeriodWinAndJackpotNotifications(int $periodId, string $periodNo, int $resultNumber): void
|
||||
{
|
||||
if ($periodId <= 0 || $periodNo === '' || $resultNumber < 1) {
|
||||
return;
|
||||
}
|
||||
self::publishSettlementWinsAfterCommit([
|
||||
'jackpot_hits' => [],
|
||||
'bet_wins' => [],
|
||||
'user_streak_events' => [],
|
||||
'wallet_events' => [],
|
||||
'settled_order_count' => 0,
|
||||
], $periodId, $periodNo, $resultNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开奖后兜底:库内已有中奖但 Redis 无 bet.win 去重键时补推(避免 streak/wallet 整期 dedup 或旧版逻辑漏推)。
|
||||
*/
|
||||
|
||||
@@ -1417,6 +1417,12 @@ final class GameLiveService
|
||||
'result_number' => $resultNumber,
|
||||
'server_time' => $now,
|
||||
]);
|
||||
|
||||
// 兜底:派彩期内每秒触发一次“最终一致”补偿(有独立去重键,最多各推一次)。
|
||||
// 用于处理“开奖推送已发,但结算推送 bet.win/jackpot.hit 因瞬时 Redis/入队失败丢失”的场景。
|
||||
if ($periodId > 0 && $periodNo !== '' && is_int($resultNumber) && $resultNumber > 0) {
|
||||
GameBetSettleService::ensurePeriodWinAndJackpotNotifications($periodId, $periodNo, $resultNumber);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user