Skip to content

Commit

Permalink
make loggers optional
Browse files Browse the repository at this point in the history
  • Loading branch information
dayaffe committed May 15, 2024
1 parent cf0a800 commit f705cfe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/ClientRuntime/Middleware/RetryMiddleware.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@ public struct RetryMiddleware<Strategy: RetryStrategy,
do {
try await strategy.refreshRetryTokenForRetry(tokenToRenew: token, errorInfo: errorInfo)
} catch {
context.getLogger()!.error("Failed to refresh retry token: \(errorInfo)")
context.getLogger()?.error("Failed to refresh retry token: \(errorInfo)")
throw operationError
}
var estimatedSkew = context.attributes.get(key: AttributeKeys.estimatedSkew)
if estimatedSkew == nil {
estimatedSkew = 0
context.getLogger()!.info("Estimated skew not found; defaulting to zero.")
context.getLogger()?.info("Estimated skew not found; defaulting to zero.")
}
var socketTimeout = context.attributes.get(key: AttributeKeys.socketTimeout)
if socketTimeout == nil {
socketTimeout = 60.0
context.getLogger()!.info("Socket timeout value not found; defaulting to 60 seconds.")
context.getLogger()?.info("Socket timeout value not found; defaulting to 60 seconds.")
}
let ttlDateUTCString = getTTL(now: Date(), estimatedSkew: estimatedSkew!, socketTimeout: socketTimeout!)
input.headers.update(
Expand Down

0 comments on commit f705cfe

Please sign in to comment.