mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-03 08:18:52 +02:00
QFIX: Restore services work (#7641)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user