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

Unified Diff: go/src/infra/gae/libs/gae/memory/taskqueue_data.go

Issue 1227203004: Convert 'Testable' interface into an optional filter. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@add_filters
Patch Set: final rebase Created 5 years, 5 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 | « go/src/infra/gae/libs/gae/memory/taskqueue.go ('k') | go/src/infra/gae/libs/gae/memory/taskqueue_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/gae/libs/gae/memory/taskqueue_data.go
diff --git a/go/src/infra/gae/libs/gae/memory/taskqueue_data.go b/go/src/infra/gae/libs/gae/memory/taskqueue_data.go
index bfdda8472052d15e7c4b441420fb0f93844753c9..f122863f6de59bb154ae777381ee31b1072647a5 100644
--- a/go/src/infra/gae/libs/gae/memory/taskqueue_data.go
+++ b/go/src/infra/gae/libs/gae/memory/taskqueue_data.go
@@ -26,7 +26,6 @@ var (
type taskQueueData struct {
sync.Mutex
- gae.BrokenFeatures
named gae.QueueData
archived gae.QueueData
@@ -39,8 +38,6 @@ var (
func newTaskQueueData() memContextObj {
return &taskQueueData{
- BrokenFeatures: gae.BrokenFeatures{
- DefaultError: errors.New("TRANSIENT_ERROR")},
named: gae.QueueData{"default": {}},
archived: gae.QueueData{"default": {}},
}
@@ -60,9 +57,8 @@ func (t *taskQueueData) applyTxn(c context.Context, obj memContextObj) {
}
func (t *taskQueueData) mkTxn(*gae.DSTransactionOptions) (memContextObj, error) {
return &txnTaskQueueData{
- BrokenFeatures: &t.BrokenFeatures,
- parent: t,
- anony: gae.AnonymousQueueData{},
+ parent: t,
+ anony: gae.AnonymousQueueData{},
}, nil
}
@@ -180,8 +176,6 @@ func (t *taskQueueData) prepTask(c context.Context, ns string, task *gae.TQTask,
/////////////////////////////// txnTaskQueueData ///////////////////////////////
type txnTaskQueueData struct {
- *gae.BrokenFeatures
-
lock sync.Mutex
// boolean 0 or 1, use atomic.*Int32 to access.
@@ -212,13 +206,13 @@ func (t *txnTaskQueueData) endTxn() {
atomic.StoreInt32(&t.closed, 1)
}
-func (t *txnTaskQueueData) RunIfNotBroken(f func() error) error {
+func (t *txnTaskQueueData) isBroken() error {
// Slightly different from the SDK... datastore and taskqueue each implement
// this here, where in the SDK only datastore.transaction.Call does.
if atomic.LoadInt32(&t.closed) == 1 {
return fmt.Errorf("taskqueue: transaction context has expired")
}
- return t.parent.RunIfNotBroken(f)
+ return nil
}
func (t *txnTaskQueueData) ResetTasks() {
« no previous file with comments | « go/src/infra/gae/libs/gae/memory/taskqueue.go ('k') | go/src/infra/gae/libs/gae/memory/taskqueue_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698