Skip to content

Commit 858029c

Browse files
committed
fix timeout error
1 parent bf8c0ca commit 858029c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

utils/arduino-connection-manager.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ async function getClientMqtt(connectionConfig, RED) {
8888
},
8989
useCloudProtocolV2: true
9090
};
91+
const timeout = setTimeout(() => { updateToken(connectionConfig) }, tokenInfo.expires_in * 1000);
9192
connections.push({
9293
clientId: connectionConfig.credentials.clientid,
9394
connectionConfig: connectionConfig,
@@ -99,7 +100,7 @@ async function getClientMqtt(connectionConfig, RED) {
99100
});
100101
await clientMqtt.connect(ArduinoCloudOptions);
101102

102-
const timeout = setTimeout(() => { updateToken(connectionConfig) }, tokenInfo.expires_in * 1000);
103+
103104

104105
} else {
105106
// TODO: what happens when token is undefined?

0 commit comments

Comments
 (0)