QFIX: Restore services work (#7641)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2025-01-11 21:53:04 +07:00
committed by GitHub
parent 59141b9096
commit dc9240218f
9 changed files with 109 additions and 57 deletions
+2
View File
@@ -36,6 +36,8 @@ export async function createPlatformClient (
},
{ mode: 'github' }
)
setMetadata(client.metadata.UseBinaryProtocol, true)
setMetadata(client.metadata.UseProtocolCompression, true)
setMetadata(client.metadata.ConnectionTimeout, timeout)
setMetadata(client.metadata.FilterModel, 'client')
const endpoint = await getTransactorEndpoint(token)
+12 -8
View File
@@ -795,6 +795,7 @@ export class PlatformWorker {
total: workspaces.length
})
let initialized = false
const worker = await GithubWorker.create(
this,
workerCtx,
@@ -811,17 +812,20 @@ export class PlatformWorker {
if (event === ClientConnectEvent.Refresh || event === ClientConnectEvent.Upgraded) {
void this.clients.get(workspace)?.refreshClient(event === ClientConnectEvent.Upgraded)
}
// We need to check if workspace is inactive
void this.checkWorkspaceIsActive(token, workspace).then((res) => {
if (res === undefined) {
this.ctx.warn('Workspace is inactive, removing from clients list.', { workspace })
this.clients.delete(workspace)
void worker?.close()
}
})
if (initialized) {
// We need to check if workspace is inactive
void this.checkWorkspaceIsActive(token, workspace).then((res) => {
if (res === undefined) {
this.ctx.warn('Workspace is inactive, removing from clients list.', { workspace })
this.clients.delete(workspace)
void worker?.close()
}
})
}
}
)
if (worker !== undefined) {
initialized = true
workerCtx.info('************************* Register worker Done ************************* ', {
workspaceId: workspaceInfo.workspaceId,
workspace: workspaceInfo.workspace,