qfix: connect timeout + service ws info cache (#9622)

1. Fix connect timeout in case of maitenance
2. Introduce workspace info cache for service accounts
3. Fix null in github integration

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2025-07-31 15:42:16 +07:00
committed by GitHub
parent 6c6436d06c
commit fb65165f80
4 changed files with 72 additions and 10 deletions
+16 -5
View File
@@ -36,7 +36,8 @@ import core, {
type PluginConfiguration,
type Ref,
type TxCUD,
platformNow
platformNow,
ClientConnectEvent
} from '@hcengineering/core'
import platform, { Severity, Status, getMetadata, getPlugins, setPlatformStatus } from '@hcengineering/platform'
import { connect } from './connection'
@@ -140,10 +141,20 @@ export default async () => {
}
}, connectTimeout)
newOpt.onConnect = async (event, lastTx, data) => {
// Any event is fine, it means server is alive.
clearTimeout(connectTO)
await opt?.onConnect?.(event, lastTx, data)
resolve()
try {
await opt?.onConnect?.(event, lastTx, data)
} catch (error) {
void clientConnection?.close()
void opt?.onDialTimeout?.()
reject(error)
return
}
if (event !== ClientConnectEvent.Maintenance) {
// Any event is fine, it means server is alive.
clearTimeout(connectTO)
resolve()
}
}
})
}