Display environment on startup

This commit is contained in:
Christoph Hagen 2023-12-19 20:45:16 +01:00
parent 5138bb543e
commit 1c57b538be
2 changed files with 6 additions and 3 deletions

View File

@ -5,6 +5,9 @@ import NIOCore
extension MultiThreadedEventLoopGroup: AsyncScheduler {
func test() {
}
public func schedule(asyncJob: @escaping @Sendable () async throws -> Void) {
_ = any().makeFutureWithTask(asyncJob)
}

View File

@ -58,12 +58,12 @@ func configure(_ app: Application) async throws {
} else {
try await serverStatus.update(.reducedFunctionality)
}
print("[\(df.string(from: Date()))] Server started (\(server.capCount) caps)")
print("[\(df.string(from: Date()))] Server started (\(app.environment.name), \(server.capCount) caps)")
}
func shutdown() {
print("[\(df.string(from: Date()))] Server shutdown")
asyncScheduler.schedule {
Task {
print("[\(df.string(from: Date()))] Server shutdown")
do {
try await asyncScheduler.shutdownGracefully()
} catch {