Compare commits
2 Commits
e6132a38b3
...
1c57b538be
Author | SHA1 | Date | |
---|---|---|---|
|
1c57b538be | ||
|
5138bb543e |
13
.gitignore
vendored
13
.gitignore
vendored
@ -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
|
|
||||||
|
@ -4,6 +4,9 @@ import Vapor
|
|||||||
import NIOCore
|
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() {
|
||||||
print("[\(df.string(from: Date()))] Server shutdown")
|
Task {
|
||||||
asyncScheduler.schedule {
|
print("[\(df.string(from: Date()))] Server shutdown")
|
||||||
do {
|
do {
|
||||||
try await asyncScheduler.shutdownGracefully()
|
try await asyncScheduler.shutdownGracefully()
|
||||||
} catch {
|
} catch {
|
||||||
|
Loading…
Reference in New Issue
Block a user