diff --git a/Sources/App/configure.swift b/Sources/App/configure.swift index 374012c..1ee1cab 100755 --- a/Sources/App/configure.swift +++ b/Sources/App/configure.swift @@ -118,10 +118,13 @@ private func migrateMetric(_ id: String, containing type: T.Type, in folder: // TODO: Write values back to disk let observer = MetricObserver(logFileFolder: folder, logMetricId: "sesame.migration") let metric: Metric = observer.addMetric(id: id) + private let semaphore = DispatchSemaphore(value: 0) Task { try await metric.update(all) print("Saved all values for metric \(id)") + semaphore.signal() } + semaphore.wait() print("Finished metric \(id)") }