Caps-Server/Sources/Run/main.swift
Christoph Hagen 623a226816 Fix semaphore
2023-02-16 23:33:19 +01:00

16 lines
295 B
Swift
Executable File

import App
import Vapor
var env = Environment.production
try LoggingSystem.bootstrap(from: &env)
let app = Application(env)
defer { app.shutdown() }
private let semaphore = DispatchSemaphore(value: 0)
Task {
try await configure(app)
semaphore.signal()
}
semaphore.wait()
try app.run()