1.增加互斥锁:保证缓存和数据库数据一致性
2.增加消费队列,保证mysql数据的正常保存
This commit is contained in:
@@ -33,7 +33,7 @@ final class GameRecordStatService
|
||||
'winner_user_count' => 0,
|
||||
'update_time' => $now,
|
||||
]);
|
||||
GameHotDataRedis::gameRecordForget($recordId);
|
||||
GameHotDataCoordinator::afterGameRecordCommitted($recordId);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -79,7 +79,7 @@ final class GameRecordStatService
|
||||
'winner_user_count' => count($winnerUserIds),
|
||||
'update_time' => $now,
|
||||
]);
|
||||
GameHotDataRedis::gameRecordForget($recordId);
|
||||
GameHotDataCoordinator::afterGameRecordCommitted($recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user