Display environment on startup
This commit is contained in:
parent
5138bb543e
commit
1c57b538be
@ -5,6 +5,9 @@ import NIOCore
|
|||||||
|
|
||||||
extension MultiThreadedEventLoopGroup: AsyncScheduler {
|
extension MultiThreadedEventLoopGroup: AsyncScheduler {
|
||||||
|
|
||||||
|
func test() {
|
||||||
|
}
|
||||||
|
|
||||||
public func schedule(asyncJob: @escaping @Sendable () async throws -> Void) {
|
public func schedule(asyncJob: @escaping @Sendable () async throws -> Void) {
|
||||||
_ = any().makeFutureWithTask(asyncJob)
|
_ = any().makeFutureWithTask(asyncJob)
|
||||||
}
|
}
|
||||||
|
@ -58,12 +58,12 @@ func configure(_ app: Application) async throws {
|
|||||||
} else {
|
} else {
|
||||||
try await serverStatus.update(.reducedFunctionality)
|
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() {
|
func shutdown() {
|
||||||
|
Task {
|
||||||
print("[\(df.string(from: Date()))] Server shutdown")
|
print("[\(df.string(from: Date()))] Server shutdown")
|
||||||
asyncScheduler.schedule {
|
|
||||||
do {
|
do {
|
||||||
try await asyncScheduler.shutdownGracefully()
|
try await asyncScheduler.shutdownGracefully()
|
||||||
} catch {
|
} catch {
|
||||||
|
Loading…
Reference in New Issue
Block a user