Skip to content

Commit

Permalink
SwiftLint
Browse files Browse the repository at this point in the history
  • Loading branch information
jguz-pubnub committed Jan 22, 2025
1 parent d84eb7d commit f137e1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/PubNub/Networking/Request/Request.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,18 @@ final class Request {

deinit {
PubNub.log.debug("Request Destroyed \(requestID)")

let currentState = atomicState.lockedRead { $0 }
let taskState = currentState.taskState

// Ensure that the response is always delivered to the caller. This situation could occur if the task is created
// but not yet resumed, and the session is invalidated in the meantime.
if taskState == .initialized {
let error = PubNubError(.clientCancelled)
atomicState.lockedWrite { $0.error = error }
finish(error: error)
}

atomicState.lockedWrite { $0.purgeAll() }
}

Expand Down

0 comments on commit f137e1d

Please sign in to comment.