Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Fixes #825: changes idx to watch id in watcher.go
Browse files Browse the repository at this point in the history
  • Loading branch information
tiffanyfay committed Apr 5, 2016
1 parent b159e8a commit 8009a61
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scheduler/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ func (t *taskWatcherCollection) handleMetricCollected(taskID string, m []core.Me
return
}
// Walk all watchers for a task ID
for i, v := range t.coll[taskID] {
for _, v := range t.coll[taskID] {
// Check if they have a catcher assigned
watcherLog.WithFields(log.Fields{
"task-id": taskID,
"task-watcher-id": i,
"task-watcher-id": v.id,
}).Debug("calling taskwatcher collection func")
// Call the catcher
v.handler.CatchCollection(m)
Expand All @@ -145,11 +145,11 @@ func (t *taskWatcherCollection) handleTaskStarted(taskID string) {
return
}
// Walk all watchers for a task ID
for i, v := range t.coll[taskID] {
for _, v := range t.coll[taskID] {
// Check if they have a catcher assigned
watcherLog.WithFields(log.Fields{
"task-id": taskID,
"task-watcher-id": i,
"task-watcher-id": v.id,
}).Debug("calling taskwatcher task started func")
// Call the catcher
v.handler.CatchTaskStarted()
Expand All @@ -168,11 +168,11 @@ func (t *taskWatcherCollection) handleTaskStopped(taskID string) {
return
}
// Walk all watchers for a task ID
for i, v := range t.coll[taskID] {
for _, v := range t.coll[taskID] {
// Check if they have a catcher assigned
watcherLog.WithFields(log.Fields{
"task-id": taskID,
"task-watcher-id": i,
"task-watcher-id": v.id,
}).Debug("calling taskwatcher task stopped func")
// Call the catcher
v.handler.CatchTaskStopped()
Expand All @@ -191,11 +191,11 @@ func (t *taskWatcherCollection) handleTaskDisabled(taskID string, why string) {
return
}
// Walk all watchers for a task ID
for i, v := range t.coll[taskID] {
for _, v := range t.coll[taskID] {
// Check if they have a catcher assigned
watcherLog.WithFields(log.Fields{
"task-id": taskID,
"task-watcher-id": i,
"task-watcher-id": v.id,
}).Debug("calling taskwatcher task disabled func")
// Call the catcher
v.handler.CatchTaskDisabled(why)
Expand Down

0 comments on commit 8009a61

Please sign in to comment.