mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
fix(hub): refresh session activity on completed turns (#524)
This commit is contained in:
@@ -63,7 +63,12 @@ export class SyncEngine {
|
||||
this.eventPublisher = new EventPublisher(sseManager, (event) => this.resolveNamespace(event))
|
||||
this.sessionCache = new SessionCache(store, this.eventPublisher)
|
||||
this.machineCache = new MachineCache(store, this.eventPublisher)
|
||||
this.messageService = new MessageService(store, io, this.eventPublisher)
|
||||
this.messageService = new MessageService(
|
||||
store,
|
||||
io,
|
||||
this.eventPublisher,
|
||||
(sessionId, updatedAt) => this.recordSessionActivity(sessionId, updatedAt)
|
||||
)
|
||||
this.rpcGateway = new RpcGateway(io, rpcRegistry)
|
||||
this.reloadAll()
|
||||
this.inactivityTimer = setInterval(() => this.expireInactive(), 5_000)
|
||||
@@ -220,6 +225,10 @@ export class SyncEngine {
|
||||
this.sessionCache.applyBackgroundTaskDelta(sessionId, delta)
|
||||
}
|
||||
|
||||
recordSessionActivity(sessionId: string, updatedAt: number): void {
|
||||
this.sessionCache.recordSessionActivity(sessionId, updatedAt)
|
||||
}
|
||||
|
||||
handleMachineAlive(payload: { machineId: string; time: number }): void {
|
||||
this.machineCache.handleMachineAlive(payload)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user