Skip to content

Commit

Permalink
Handle re-entry in SessionDataTask.resume()
Browse files Browse the repository at this point in the history
Alamofire can (during cancelation) attempt to resume an already running
task.
  • Loading branch information
alexdeem committed Jan 8, 2024
1 parent 021c3a8 commit 0438c04
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/DVR/SessionDataTask.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ final class SessionDataTask: URLSessionDataTask {
}

override func resume() {
if _state == .running {
return
}

let cassette = session.cassette

_state = .running
Expand Down

0 comments on commit 0438c04

Please sign in to comment.