fix: Disable polling transport for RTS (#15773)

Disable polling transport for RTS

This is required to support clustering of RTS, and with it, the Appsmith server.
This commit is contained in:
Shrikant Sharat Kandula 2022-08-06 12:36:11 +05:30 committed by GitHub
parent bd555c1bfd
commit 31481ddaae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,6 +36,10 @@ import { SOCKET_CONNECTION_EVENTS } from "./socketEvents";
function connect(namespace?: string) {
const options = {
path: RTS_BASE_PATH,
// The default transports is ["polling", "websocket"], so polling is tried first. But polling
// needs sticky session to be turned on, in a clustered environment, even for it to upgrade to websockets.
// Ref: <https://github.com/socketio/socket.io/issues/2140>.
transports: ["websocket"],
};
const socket = !!namespace ? io(namespace, options) : io(options);