SHA256
Разделить среды и закрепить лицензии в HEADER 1.0
This commit is contained in:
@@ -83,6 +83,7 @@ export class WsJsonClient {
|
||||
}
|
||||
|
||||
async open() {
|
||||
if (this.retired) throw new Error('Server connection retired');
|
||||
if (this.ws && this.ws.readyState === WebSocket.OPEN) return;
|
||||
if (this.openPromise) return this.openPromise;
|
||||
if (isMixedContentWs(this.url)) {
|
||||
@@ -102,6 +103,7 @@ export class WsJsonClient {
|
||||
this.connectionGeneration += 1;
|
||||
|
||||
ws.addEventListener('open', () => {
|
||||
if (this.retired) { ws.close(); reject(new Error('Server connection retired')); return; }
|
||||
resolve();
|
||||
}, { once: true });
|
||||
|
||||
@@ -138,7 +140,7 @@ export class WsJsonClient {
|
||||
if (this.requestGuard) await this.requestGuard(op);
|
||||
if (this.ws && this.ws.readyState === WebSocket.OPEN) break;
|
||||
}
|
||||
if (!this.ws || this.ws.readyState !== WebSocket.OPEN || (existingOnly && !this.isSessionReady())) {
|
||||
if (this.retired || !this.ws || this.ws.readyState !== WebSocket.OPEN || (existingOnly && !this.isSessionReady())) {
|
||||
throw new Error(t('remaining.websocket.websocket_connection_closed'));
|
||||
}
|
||||
const requestId = createRequestId(op);
|
||||
|
||||
Reference in New Issue
Block a user