Skip to content

Implement websocket reconnect #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
FabioRosado opened this issue Jun 4, 2022 · 0 comments
Open

Implement websocket reconnect #26

FabioRosado opened this issue Jun 4, 2022 · 0 comments
Labels
opsdroid-web-v2 Issues related to the upcoming version of opsdroid web

Comments

@FabioRosado
Copy link
Member

On v1 we have a reconnect method that is triggered when we lose connection or when we change the websocket URL. We should implement a similar thing in v2.

For reference:

  reconnectToWebSocket() {
    if (this.active_connection && this.active_connection.connected) {
      this.active_connection.close();
    }
    if (this.connectionTimeout) {
      clearTimeout(this.connectionTimeout);
    }
    console.log(`Reconnecting in ${this.connectionCooldown} seconds.`);
    this.connectionTimeout = setTimeout(this.connectToWebsocket, this.connectionCooldown * 1000);
    this.backoffCooldown();
  }
@FabioRosado FabioRosado added the opsdroid-web-v2 Issues related to the upcoming version of opsdroid web label Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
opsdroid-web-v2 Issues related to the upcoming version of opsdroid web
Projects
None yet
Development

No branches or pull requests

1 participant