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

Unified Diff: filter/count/tq.go

Issue 2512093002: Add support for Pull Queues to prod implementation. (Closed)
Patch Set: use time.Duration for leaseTime Created 4 years, 1 month 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 | filter/featureBreaker/tq.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filter/count/tq.go
diff --git a/filter/count/tq.go b/filter/count/tq.go
index f2be798f560f2e6ebcf5a6420cd8c5e37a7c77ee..fd3164a6a68b34211a181368b245da8f8217bfcd 100644
--- a/filter/count/tq.go
+++ b/filter/count/tq.go
@@ -5,6 +5,8 @@
package count
import (
+ "time"
+
"golang.org/x/net/context"
tq "github.com/luci/gae/service/taskqueue"
@@ -14,6 +16,9 @@ import (
type TQCounter struct {
AddMulti Entry
DeleteMulti Entry
+ Lease Entry
+ LeaseByTag Entry
+ ModifyLease Entry
Purge Entry
Stats Entry
}
@@ -34,6 +39,22 @@ func (t *tqCounter) DeleteMulti(tasks []*tq.Task, queueName string, cb tq.RawCB)
return t.c.DeleteMulti.up(t.tq.DeleteMulti(tasks, queueName, cb))
}
+func (t *tqCounter) Lease(maxTasks int, queueName string, leaseTime time.Duration) ([]*tq.Task, error) {
+ tasks, err := t.tq.Lease(maxTasks, queueName, leaseTime)
+ t.c.Lease.up(err)
+ return tasks, err
+}
+
+func (t *tqCounter) LeaseByTag(maxTasks int, queueName string, leaseTime time.Duration, tag string) ([]*tq.Task, error) {
+ tasks, err := t.tq.LeaseByTag(maxTasks, queueName, leaseTime, tag)
+ t.c.LeaseByTag.up(err)
+ return tasks, err
+}
+
+func (t *tqCounter) ModifyLease(task *tq.Task, queueName string, leaseTime time.Duration) error {
+ return t.c.ModifyLease.up(t.tq.ModifyLease(task, queueName, leaseTime))
+}
+
func (t *tqCounter) Purge(queueName string) error {
return t.c.Purge.up(t.tq.Purge(queueName))
}
« no previous file with comments | « no previous file | filter/featureBreaker/tq.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698