Skip to content

Conversation

@clcreuso
Copy link
Contributor

@clcreuso clcreuso commented Feb 1, 2021

The reconnect options (for websocket) is not working for me.

Now i can make my reconnection manualy, like this:

const newSubscribedMessage = async (message) => {
  logger.fatal(`BINANCE_WS_SUBSCRIBED_MESSAGE ${JSON.stringify(message)}`);

  if (message === 'listenKeyExpired') {
    const endpoints = binance.futuresSubscriptions();

    for (const endpoint in endpoints) {
      binance.futuresTerminate(endpoint);
    }

    websocketConnection();
  }
};

function websocketConnection() {
  logger.warn('FUTURE_DATA_STREAM CONNECTION');

  binance.websockets.userFutureData(
    newMarginMessage,
    newAccountMessage,
    newOrderMessage,
    newSubscribedMessage,
  );
}

@clcreuso
Copy link
Contributor Author

clcreuso commented Feb 3, 2021

If you think this is a good feature, tell me. I will do the same for other websockets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant