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

    @stats.passing = _.keys(@stats.flows).length != 0
    _.each @stats.flows, (flowInfo) =>
      @stats.passing = false if !flowInfo.passing

    return @stats

  getFlows: (callback) =>
    @requestOctobluUrl 'GET', '/api/flows', (error, body) =>


  restartFailedFlows: (callback=->) =>
    debug 'restarting failed flows'
    @updateStats()
    flowStarters = []
    _.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
