Add reverse geocoding service (#1085)

* add Geocoding service

* move url session extension
This commit is contained in:
Flescio
2023-06-15 16:40:42 +02:00
committed by GitHub
parent 2cfc844545
commit 163e38b1a9
12 changed files with 190 additions and 29 deletions
@@ -342,14 +342,3 @@ extension BugReportService: URLSessionTaskDelegate {
.store(in: &cancellables)
}
}
private extension URLSession {
/// The same as `data(for:delegate:)` but with an additional immediate retry if the first attempt fails.
func dataWithRetry(for request: URLRequest, delegate: URLSessionTaskDelegate? = nil) async throws -> (Data, URLResponse) {
if let firstTryResult = try? await data(for: request, delegate: delegate) {
return firstTryResult
}
return try await data(for: request, delegate: delegate)
}
}