stefanes / PSTibber

PowerShell module for accessing the Tibber GraphQL API
https://www.powershellgallery.com/packages/PSTibber
MIT License
7 stars 0 forks source link

Connect-TibberWebSocket sometimes fails with error 4500 #5

Closed stefanes closed 2 years ago

stefanes commented 2 years ago

The function Connect-TibberWebSocket sometime fails with error 4500, internal server error. Add some retry functionality to retry connection after a few seconds.

VERBOSE: WebSocket connected to wss://api.tibber.com/v1-beta/gql/subscriptions
VERBOSE: Init message sent
VERBOSE: Receive failed: Internal server error [4500]
VERBOSE: Retrying in 5 seconds, 4 attempts left
VERBOSE: WebSocket connected to wss://api.tibber.com/v1-beta/gql/subscriptions
VERBOSE: Init message sent
VERBOSE: Receive failed: Internal server error [4500]
VERBOSE: Retrying in 5 seconds, 3 attempts left
VERBOSE: WebSocket connected to wss://api.tibber.com/v1-beta/gql/subscriptions
VERBOSE: Init message sent
VERBOSE: Init response: {"type":"connection_ack"}
Read 1 packages in 2.8790881 seconds