Index: build_scheduler/go/db/modified_tasks.go |
diff --git a/build_scheduler/go/db/modified_tasks.go b/build_scheduler/go/db/modified_tasks.go |
index 7408481e591ff6da14a8d8e441ed3bfba459268a..0fde3e4d67996991dce98fe0ec7580b310d55ee7 100644 |
--- a/build_scheduler/go/db/modified_tasks.go |
+++ b/build_scheduler/go/db/modified_tasks.go |
@@ -61,12 +61,19 @@ func (m *ModifiedTasks) clearExpiredSubscribers() { |
// TrackModifiedTask indicates the given Task should be returned from the next |
// call to GetModifiedTasks from each subscriber. |
func (m *ModifiedTasks) TrackModifiedTask(t *Task) { |
+ m.TrackModifiedTasks([]*Task{t}) |
+} |
+ |
+// TrackModifiedTasks calls TrackModifiedTask on each item. |
+func (m *ModifiedTasks) TrackModifiedTasks(tasks []*Task) { |
m.mtx.Lock() |
defer m.mtx.Unlock() |
- // Make a single copy, since GetModifiedTasks also copies. |
- t = t.Copy() |
- for _, modTasks := range m.tasks { |
- modTasks[t.Id] = t |
+ for _, t := range tasks { |
+ // Make a single copy, since GetModifiedTasks also copies. |
+ t = t.Copy() |
+ for _, modTasks := range m.tasks { |
+ modTasks[t.Id] = t |
+ } |
} |
} |