Compare commits
No commits in common. "1c57b538be07fbb6b2f8d6b17cc9c865bd960d38" and "e6132a38b3df9c86085a902caefb94c8f727e192" have entirely different histories.
1c57b538be
...
e6132a38b3
13
.gitignore
vendored
13
.gitignore
vendored
@ -8,11 +8,12 @@
|
|||||||
.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/
|
||||||
Resources/config.json
|
Public/classifier.version
|
||||||
Resources/logs/
|
Public/classifier.mlmodel
|
||||||
|
Public/caps.json
|
||||||
|
Training/backup/
|
||||||
|
Training/config.json
|
||||||
|
Public/thumbnails
|
||||||
|
Public/count.js
|
||||||
|
@ -4,9 +4,6 @@ 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 (\(app.environment.name), \(server.capCount) caps)")
|
print("[\(df.string(from: Date()))] Server started (\(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