Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Unified Diff: tumble/fire_tasks.go

Issue 2617043005: Use batch add for Tumble task queue tasks. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tumble/fire_tasks.go
diff --git a/tumble/fire_tasks.go b/tumble/fire_tasks.go
index e0ba079b880cfc0da0df516e8e79a51a0f9f5384..15ee6e3324c2f14d1ad92648d9dbb933935d4266 100644
--- a/tumble/fire_tasks.go
+++ b/tumble/fire_tasks.go
@@ -78,7 +78,8 @@ func fireTasks(c context.Context, cfg *Config, shards map[taskShard]struct{}) bo
logging.Infof(c, "added task %q %s %s", tsk.Name, tsk.Path, tsk.ETA)
}
- if err := errors.Filter(tq.Add(ds.WithoutTransaction(c), baseName, tasks...), tq.ErrTaskAlreadyAdded); err != nil {
+ b := tq.Batcher{}
+ if err := errors.Filter(b.Add(ds.WithoutTransaction(c), baseName, tasks...), tq.ErrTaskAlreadyAdded); err != nil {
logging.Warningf(c, "attempted to fire tasks %v, but failed: %s", shards, err)
return false
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698