OCI's HTTP client: prevent the usage of NIO Transport Services (#168)

This commit is contained in:
Nikolay Edigaryev
2022-08-01 18:17:50 -04:00
committed by GitHub
parent b1534a05d5
commit 56ddd8df75
+5 -2
View File
@@ -2,6 +2,7 @@ import Foundation
import NIOCore
import NIOHTTP1
import AsyncHTTPClient
import NIOPosix
enum RegistryError: Error {
case UnexpectedHTTPStatusCode(when: String, code: UInt, details: String = "")
@@ -75,8 +76,10 @@ struct TokenResponse: Decodable, Authentication {
}
class Registry {
private let httpClient = HTTPClient(eventLoopGroupProvider: .createNew)
private let httpClient = HTTPClient(
eventLoopGroupProvider: .shared(MultiThreadedEventLoopGroup(numberOfThreads: 1))
)
deinit {
try! httpClient.syncShutdown()
}