Skip to content

Commit

Permalink
Update server entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
mattesmohr committed Jan 16, 2024
1 parent 284b956 commit ac54514
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
23 changes: 0 additions & 23 deletions Sources/Website/Extensions/Website+Vapor.swift
Original file line number Diff line number Diff line change
@@ -1,28 +1,5 @@
import Vapor

extension Application {

static let baseExecutionQueue = DispatchQueue(label: "vapor.codes.entrypoint")

func runFromAsyncMainEntrypoint() async throws {

try await withCheckedThrowingContinuation { continuation in

Application.baseExecutionQueue.async { [self] in

do {
try self.run()

continuation.resume()

} catch {
continuation.resume(throwing: error)
}
}
}
}
}

extension File {

public var name: String? {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Website/Setup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct Setup {
throw error
}

try await application.runFromAsyncMainEntrypoint()
try await application.execute()
}

static func routes(_ application: Application) async throws {
Expand Down

0 comments on commit ac54514

Please sign in to comment.