Skip to content

Commit

Permalink
refactor: fix error and refactor connection
Browse files Browse the repository at this point in the history
  • Loading branch information
gulivero1773 committed Apr 25, 2024
1 parent ee351ff commit 3ccb8b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public struct PostgresHealthChecks: PostgresHealthChecksProtocol {
let result = HealthCheckItem(
componentId: app.psqlId,
componentType: .datastore,
observedValue: 1,
observedValue: connectionDescription.contains("active") ? 1 : 0,
status: connectionDescription.contains("active") ? .pass : .fail,
time: app.dateTimeISOFormat.string(from: Date()),
output: !connectionDescription.contains("active") ? connectionDescription : nil,
Expand Down
4 changes: 4 additions & 0 deletions Tests/HealthChecksTests/Mocks/PostgresHealthChecksMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,8 @@ public struct PostgresHealthChecksMock: PostgresHealthChecksProtocol {
]
return result
}

public func checkConnection() async -> String {
"active"
}
}

0 comments on commit 3ccb8b5

Please sign in to comment.