Attempt fix
This commit is contained in:
parent
bc104a9040
commit
66a04781d3
@ -23,9 +23,7 @@ private let dateFormatter: DateFormatter = {
|
||||
public func configure(_ app: Application) async throws {
|
||||
let storageFolder = URL(fileURLWithPath: app.directory.resourcesDirectory)
|
||||
let logFolder = storageFolder.appendingPathComponent("logs")
|
||||
try migrate(folder: logFolder)
|
||||
fatalError("Done")
|
||||
|
||||
|
||||
let monitor = MetricObserver(logFileFolder: logFolder, logMetricId: "sesame.log")
|
||||
MetricObserver.standard = monitor
|
||||
|
||||
@ -91,7 +89,7 @@ func log(_ message: String) {
|
||||
|
||||
import CBORCoding
|
||||
|
||||
private func migrate(folder: URL) throws {
|
||||
public func migrate(folder: URL) throws {
|
||||
try migrateMetric("sesame.log", containing: String.self, in: folder)
|
||||
try migrateMetric("sesame.status", containing: ServerStatus.self, in: folder)
|
||||
try migrateMetric("sesame.connected", containing: Bool.self, in: folder)
|
||||
|
@ -6,6 +6,12 @@ try LoggingSystem.bootstrap(from: &env)
|
||||
let app = Application(env)
|
||||
defer { app.shutdown() }
|
||||
|
||||
let storageFolder = URL(fileURLWithPath: app.directory.resourcesDirectory)
|
||||
let logFolder = storageFolder.appendingPathComponent("logs")
|
||||
print("Starting migration")
|
||||
try migrate(folder: logFolder)
|
||||
print("Finished migration")
|
||||
/*
|
||||
private let semaphore = DispatchSemaphore(value: 0)
|
||||
Task {
|
||||
try await configure(app)
|
||||
@ -13,3 +19,4 @@ Task {
|
||||
}
|
||||
semaphore.wait()
|
||||
try app.run()
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user