 
   restartFailedFlows: (callback=->) =>
     debug 'restarting failed flows'
-    stats = @getCurrentStats()
+    @updateStats()
     flowStarters = []
-    _.each _.keys(stats.flows), (flowUuid) =>
-      flowInfo = stats.flows[flowUuid]
+    _.each _.keys(@stats.flows), (flowUuid) =>
+      flowInfo = @stats.flows[flowUuid]
       if flowInfo.currentTimeDiff > @CANARY_RESTART_FLOWS_MAX_TIME
         debug "restarting failed flow #{flowUuid}"
         flowStarters.push @curryStartFlow flowUuid


  postTriggers: (callback=->) =>
    debug 'posting triggers'
    triggers = @getTriggers()
    async.each triggers, (trigger, callback) =>
      flowInfo = @stats.flows[trigger.flowId] ?= {}
      triggerInfo = flowInfo.triggerTime ?= {}
      triggerTime = triggerInfo[trigger.triggerId] ?= []

        delete @stats.flows[flowUuid]

  getCurrentStats: =>
    @updateStats()
    return @stats

  updateStats: =>
    _.each @stats.flows, (flowInfo) =>
      flowInfo.passing = false
      return unless flowInfo.messageTime
