Fix onConnect handler (#7265)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2024-12-05 22:29:54 +07:00
committed by GitHub
parent d13c80be5f
commit ecf4064f69
8 changed files with 21 additions and 17 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ import config from './config'
export async function createPlatformClient (
workspace: string,
timeout: number,
reconnect?: (event: ClientConnectEvent) => void
reconnect?: (event: ClientConnectEvent, data: any) => Promise<void>
): Promise<Client> {
setMetadata(client.metadata.ClientSocketFactory, (url) => {
return new WebSocket(url, {
+1 -1
View File
@@ -1560,7 +1560,7 @@ export class GithubWorker implements IntegrationManager {
ctx.info('Connecting to', { workspace: workspace.workspaceUrl, workspaceId: workspace.workspaceName })
let client: Client | undefined
try {
client = await createPlatformClient(workspace.name, 30000, (event: ClientConnectEvent) => {
client = await createPlatformClient(workspace.name, 30000, async (event: ClientConnectEvent) => {
reconnect(workspace.name, event)
})