1.增加互斥锁:保证缓存和数据库数据一致性
2.增加消费队列,保证mysql数据的正常保存
This commit is contained in:
@@ -99,7 +99,7 @@ final class GameRecordService
|
||||
'create_time' => $now,
|
||||
'update_time' => $now,
|
||||
]);
|
||||
GameHotDataRedis::gameRecordForget();
|
||||
GameHotDataCoordinator::afterGameRecordCommitted(null);
|
||||
return $periodNo;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ final class GameRecordService
|
||||
'remark' => $remark,
|
||||
'update_time' => $now,
|
||||
]);
|
||||
GameHotDataRedis::gameConfigForget($key);
|
||||
GameHotDataCoordinator::afterGameConfigKeyCommitted($key);
|
||||
return;
|
||||
}
|
||||
Db::name('game_config')->insert([
|
||||
@@ -134,6 +134,6 @@ final class GameRecordService
|
||||
'create_time' => $now,
|
||||
'update_time' => $now,
|
||||
]);
|
||||
GameHotDataRedis::gameConfigForget($key);
|
||||
GameHotDataCoordinator::afterGameConfigKeyCommitted($key);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user