Skip to content

Commit

Permalink
refactor(iot-dev): Fix javadocs for SAS token expiry time, fix reconn…
Browse files Browse the repository at this point in the history
…ection sample (#1505)

expiry time javadocs didn't mention the time unit and reconnection sample was missing a check on the status
  • Loading branch information
timtay-microsoft authored Mar 30, 2022
1 parent 04b0a74 commit 1618e03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public final class ClientOptions
private final int httpsConnectTimeout = DEFAULT_HTTPS_CONNECT_TIMEOUT_MILLISECONDS;

/**
* This option is applicable for HTTP/AMQP/MQTT. This option specifies the time to live for all generated
* SAS tokens. By default, this value is 1 hour.
* This option specifies the time to live (in seconds) for all SAS tokens generated for this client. By default,
* this value is 1 hour.
*/
@Getter
@Builder.Default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void run()
System.exit(-1);
}

if (newStatusReason == IotHubConnectionStatusChangeReason.EXPIRED_SAS_TOKEN)
if (newStatus == IotHubConnectionStatus.DISCONNECTED && newStatusReason == IotHubConnectionStatusChangeReason.EXPIRED_SAS_TOKEN)
{
// should only happen if the user provides a shared access signature instead of a connection string.
// indicates that the device client is now unusable because there is no way to renew the shared
Expand Down

0 comments on commit 1618e03

Please sign in to comment.