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

Unified Diff: filter/dscache/ds_txn_state.go

Issue 2302743002: Interface update, per-method Contexts. (Closed)
Patch Set: Lightning talk licenses. Created 4 years, 3 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 | « filter/dscache/ds.go ('k') | filter/dscache/dscache_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filter/dscache/ds_txn_state.go
diff --git a/filter/dscache/ds_txn_state.go b/filter/dscache/ds_txn_state.go
index 3038153582bf2531e87da355400b7fe97d0a8aa3..56b13314de80db3d85880bc4ab3cbf93cd7b40c9 100644
--- a/filter/dscache/ds_txn_state.go
+++ b/filter/dscache/ds_txn_state.go
@@ -8,7 +8,8 @@ import (
"sync"
"github.com/luci/gae/service/datastore"
- "github.com/luci/gae/service/memcache"
+ mc "github.com/luci/gae/service/memcache"
+
"github.com/luci/luci-go/common/errors"
log "github.com/luci/luci-go/common/logging"
)
@@ -16,7 +17,7 @@ import (
type dsTxnState struct {
sync.Mutex
- toLock []memcache.Item
+ toLock []mc.Item
toDelete map[string]struct{}
}
@@ -41,10 +42,10 @@ func (s *dsTxnState) apply(sc *supportContext) error {
// this is a hard failure. No mutation can occur if we're unable to set
// locks out. See "DANGER ZONE" in the docs.
- err := sc.mc.SetMulti(s.toLock)
+ err := mc.Set(sc.c, s.toLock...)
if err != nil {
(log.Fields{log.ErrorKey: err}).Errorf(
- sc.c, "dscache: HARD FAILURE: dsTxnState.apply(): mc.SetMulti")
+ sc.c, "dscache: HARD FAILURE: dsTxnState.apply(): mc.Set")
}
return err
}
@@ -61,9 +62,9 @@ func (s *dsTxnState) release(sc *supportContext) {
delKeys = append(delKeys, k)
}
- if err := errors.Filter(sc.mc.DeleteMulti(delKeys), memcache.ErrCacheMiss); err != nil {
+ if err := errors.Filter(mc.Delete(sc.c, delKeys...), mc.ErrCacheMiss); err != nil {
(log.Fields{log.ErrorKey: err}).Warningf(
- sc.c, "dscache: txn.release: memcache.DeleteMulti")
+ sc.c, "dscache: txn.release: memcache.Delete")
}
}
« no previous file with comments | « filter/dscache/ds.go ('k') | filter/dscache/dscache_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698