Skip to content

Commit

Permalink
Improve Linux build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
finestructure committed Dec 30, 2023
1 parent 8c7d448 commit 8da76fc
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Sources/ValidatorCore/Github.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ import AsyncHTTPClient
import NIO
import NIOHTTP1

#if os(Linux)
import CDispatch // for NSEC_PER_SEC https://github.com/apple/swift-corelibs-libdispatch/issues/659
#endif


/// Github specific functionality
enum Github {
Expand Down Expand Up @@ -177,7 +181,7 @@ extension Github {
return EventLoopFuture.whenAllSucceed(req, on: client.eventLoopGroup.next())
}


static func fetch<T: Decodable>(_ type: T.Type, client: HTTPClient, url: URL) async throws -> T {
let body = try await Current.fetch(client, url).get()
do {
Expand Down Expand Up @@ -229,8 +233,3 @@ extension Github {
}

}


#if os(Linux)
let NSEC_PER_SEC = UInt64(1_000_000_000)
#endif

0 comments on commit 8da76fc

Please sign in to comment.