feat: RedisTurnDaemonTransport에서 lastId 초기값을 '0-0'으로 변경 및 RedisCommandStream에서 블록 시간 제한 추가
This commit is contained in:
@@ -137,11 +137,12 @@ export class RedisTurnDaemonCommandStream implements TurnDaemonControlQueue, Tur
|
||||
}
|
||||
|
||||
const blockMs = deadlineMs === null ? 0 : Math.max(0, deadlineMs - Date.now());
|
||||
const cappedBlockMs = deadlineMs === null ? 0 : Math.min(blockMs, 1000);
|
||||
if (deadlineMs !== null && blockMs === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const remote = await this.readRemoteCommands(blockMs);
|
||||
const remote = await this.readRemoteCommands(cappedBlockMs);
|
||||
if (remote.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -327,9 +327,13 @@ export const createDatabaseTurnHooks = async (
|
||||
...nations
|
||||
.filter((nation) => !createdNationIds.has(nation.id))
|
||||
.map((nation) =>
|
||||
prisma.nation.update({
|
||||
prisma.nation.upsert({
|
||||
where: { id: nation.id },
|
||||
data: buildNationUpdate(nation),
|
||||
update: buildNationUpdate(nation),
|
||||
create: {
|
||||
id: nation.id,
|
||||
...buildNationUpdate(nation),
|
||||
},
|
||||
})
|
||||
),
|
||||
...troops
|
||||
|
||||
Reference in New Issue
Block a user