UBERF-7854: Fix live query $lookup update (#6304)

This commit is contained in:
Andrey Sobolev
2024-08-09 18:52:44 +07:00
committed by GitHub
parent 00633cda71
commit 9215e966cd
4 changed files with 37 additions and 76 deletions
+13
View File
@@ -1491,6 +1491,8 @@ export class GithubWorker implements IntegrationManager {
reconnect(workspace.name, event)
})
await GithubWorker.checkIntegrations(client, installations)
const worker = new GithubWorker(
ctx,
platformWorker,
@@ -1510,6 +1512,17 @@ export class GithubWorker implements IntegrationManager {
await client?.close()
}
}
static async checkIntegrations (client: Client, installations: Map<number, InstallationRecord>): Promise<void> {
const wsIntegerations = await client.findAll(github.class.GithubIntegration, {})
for (const intValue of wsIntegerations) {
if (!installations.has(intValue.installationId)) {
const ops = new TxOperations(client, core.account.System)
await ops.remove<GithubIntegration>(intValue)
}
}
}
}
export async function syncUser (