lib/heartcheck/executors/base.rb in heartcheck-1.0.7 vs lib/heartcheck/executors/base.rb in heartcheck-1.0.8

- old
+ new

@@ -1,14 +1,18 @@ module Heartcheck module Executors class Base def dispatch(checkers) checkers.map do |checker| - started = Time.now - checker.check.tap do |checked| - checked[:time] = ((Time.now - started) * 1_000.0) - Logger.info Oj.dump(checked) - end + track_and_check(checker) + end + end + + def track_and_check(checker) + started = Time.now + checker.check.tap do |checked| + checked[:time] = ((Time.now - started) * 1_000.0) + Logger.info Oj.dump(checked) end end end end end