mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-07 08:21:08 +00:00
server ping
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
78e69338e7
commit
730be4e895
@ -51,6 +51,11 @@ class Connection implements Storage {
|
|||||||
this.handler(resp.result as Tx)
|
this.handler(resp.result as Tx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const interval = setInterval(() => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||||
|
this.sendRequest('ping')
|
||||||
|
}, 10000)
|
||||||
|
this.webSocket.onclose = () => { console.log('client websocket closed'); clearInterval(interval) }
|
||||||
}
|
}
|
||||||
|
|
||||||
private sendRequest (method: string, ...params: any[]): Promise<any> {
|
private sendRequest (method: string, ...params: any[]): Promise<any> {
|
||||||
|
@ -39,6 +39,8 @@ class Session implements Storage {
|
|||||||
private readonly storage: ServerStorage
|
private readonly storage: ServerStorage
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
async ping (): Promise<string> { return 'pong!' }
|
||||||
|
|
||||||
async findAll <T extends Doc>(_class: Ref<Class<T>>, query: DocumentQuery<T>, options?: FindOptions<T>): Promise<FindResult<T>> {
|
async findAll <T extends Doc>(_class: Ref<Class<T>>, query: DocumentQuery<T>, options?: FindOptions<T>): Promise<FindResult<T>> {
|
||||||
return await this.storage.findAll(_class, query, options)
|
return await this.storage.findAll(_class, query, options)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user