We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc975ca commit 3d9029aCopy full SHA for 3d9029a
Sources/App/Core/AppMetrics.swift
@@ -26,9 +26,11 @@ enum AppMetrics {
26
static func bootstrap() {
27
// prevent tests from boostrapping multiple times
28
guard !initialized.withLock({ $0 }) else { return }
29
- defer { initialized.withLock{ $0 = true } }
30
- let client = PrometheusClient()
31
- MetricsSystem.bootstrap(PrometheusMetricsFactory(client: client))
+ initialized.withLock {
+ let client = PrometheusClient()
+ MetricsSystem.bootstrap(PrometheusMetricsFactory(client: client))
32
+ $0 = true
33
+ }
34
}
35
36
// metrics
0 commit comments