Compare commits

..

2 Commits

Author SHA1 Message Date
Christoph Hagen
1c57b538be Display environment on startup 2023-12-19 20:45:16 +01:00
Christoph Hagen
5138bb543e Ignore more files 2023-12-19 20:45:02 +01:00
3 changed files with 12 additions and 10 deletions

13
.gitignore vendored
View File

@ -8,12 +8,11 @@
.DS_Store .DS_Store
Package.resolved Package.resolved
.swiftpm/ .swiftpm/
Public/caps.json
Public/changes.txt
Public/classifier.*
Public/count.*
Public/images/ Public/images/
Public/thumbnails/ Public/thumbnails/
Public/classifier.version Resources/config.json
Public/classifier.mlmodel Resources/logs/
Public/caps.json
Training/backup/
Training/config.json
Public/thumbnails
Public/count.js

View File

@ -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)
} }

View File

@ -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 {