From 795736426964a56f2753413da1c6b41e7e346043 Mon Sep 17 00:00:00 2001 From: noerog <32459203+noerog@users.noreply.github.com> Date: Wed, 3 Jan 2018 18:14:41 -0500 Subject: [PATCH] Add region tags to JWT refresh. (#544) * Add region tags to JWT refresh. --- iot/mqtt_example/cloudiot_mqtt_example_nodejs.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iot/mqtt_example/cloudiot_mqtt_example_nodejs.js b/iot/mqtt_example/cloudiot_mqtt_example_nodejs.js index 0e2040300d..901adae3d4 100644 --- a/iot/mqtt_example/cloudiot_mqtt_example_nodejs.js +++ b/iot/mqtt_example/cloudiot_mqtt_example_nodejs.js @@ -132,6 +132,7 @@ function publishAsync (messageCount, numMessages) { if (messageCount < numMessages) { // If we have published fewer than numMessage messages, publish payload // messageCount + 1 in 1 second. + // [START iot_mqtt_jwt_refresh] setTimeout(function () { let secsFromIssue = parseInt(Date.now() / 1000) - iatTime; if (secsFromIssue > argv.tokenExpMins * 60) { @@ -169,6 +170,7 @@ function publishAsync (messageCount, numMessages) { } publishAsync(messageCount + 1, numMessages); }, delayMs); + // [END iot_mqtt_jwt_refresh] } else { // Otherwise, close the connection. console.log('Closing connection to MQTT. Goodbye!');