mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-23 01:55:00 +02:00
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:
@@ -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()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user