Skip to content

Commit

Permalink
Fix stateMachineQueue health check (#2883)
Browse files Browse the repository at this point in the history
  • Loading branch information
SidSethi committed Apr 8, 2022
1 parent 8ccb789 commit b91e991
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ const healthCheckController = async (req) => {
if (enforceStateMachineQueueHealth && stateMachineQueueLatestJobSuccess) {
const healthyThresholdMs = 5 * config.get('snapbackJobInterval')

const delta = Date.now() - stateMachineQueueLatestJobSuccess.getTime()
const delta =
Date.now() - new Date(stateMachineQueueLatestJobSuccess).getTime()
if (delta > healthyThresholdMs) {
return errorResponseServerError(
`StateMachineQueue not healthy - last successful run ${delta}ms ago not within healthy threshold of ${healthyThresholdMs}ms`
Expand Down

0 comments on commit b91e991

Please sign in to comment.