File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
1
import ConsoleKit
2
2
import NIOCore
3
3
import NIOPosix
4
+ import NIOConcurrencyHelpers
4
5
import Logging
5
6
import Vapor
6
- import FluentKit
7
+ @ preconcurrency import FluentKit
7
8
8
9
extension Request {
9
10
public var db : any Database {
@@ -78,18 +79,18 @@ extension Application {
78
79
}
79
80
80
81
public struct Fluent {
81
- final class Storage : @ unchecked Sendable {
82
+ final class Storage : Sendable {
82
83
let databases : Databases
83
84
let migrations : Migrations
84
- var migrationLogLevel : Logger . Level
85
+ let migrationLogLevel : NIOLockedValueBox < Logger . Level >
85
86
86
87
init ( threadPool: NIOThreadPool , on eventLoopGroup: any EventLoopGroup , migrationLogLevel: Logger . Level ) {
87
88
self . databases = Databases (
88
89
threadPool: threadPool,
89
90
on: eventLoopGroup
90
91
)
91
92
self . migrations = . init( )
92
- self . migrationLogLevel = migrationLogLevel
93
+ self . migrationLogLevel = . init ( migrationLogLevel)
93
94
}
94
95
}
95
96
@@ -143,8 +144,8 @@ extension Application {
143
144
}
144
145
145
146
public var migrationLogLevel : Logger . Level {
146
- get { self . storage. migrationLogLevel }
147
- nonmutating set { self . storage. migrationLogLevel = newValue }
147
+ get { self . storage. migrationLogLevel. withLockedValue { $0 } }
148
+ nonmutating set { self . storage. migrationLogLevel. withLockedValue { $0 = newValue } }
148
149
}
149
150
150
151
public var history : History {
You can’t perform that action at this time.
0 commit comments