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

Unified Diff: appengine/datastorecache/model.go

Issue 2645763002: datastorecache: Add Locker field, public settings. (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 | « appengine/datastorecache/lock.go ('k') | appengine/datastorecache/util_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/datastorecache/model.go
diff --git a/appengine/datastorecache/model.go b/appengine/datastorecache/model.go
index b7e31775a60daa1579422738b55e080ce774b0b0..04734f6169d9dafa2a6948ebd05960cdad4d6840 100644
--- a/appengine/datastorecache/model.go
+++ b/appengine/datastorecache/model.go
@@ -7,16 +7,11 @@ package datastorecache
import (
"crypto/sha256"
"encoding/hex"
- "fmt"
"strings"
"sync"
"time"
- "github.com/luci/luci-go/appengine/memlock"
-
"github.com/luci/gae/service/datastore"
-
- "golang.org/x/net/context"
)
// entry is a single cached value.
@@ -136,11 +131,8 @@ func (e *entry) SetMeta(key string, val interface{}) bool {
return datastore.GetPLS(e).SetMeta(key, val)
}
-// tryWithLock invokes memlock.TryWithLock, locking around a key unique to this
-// cache entry.
-func (e *entry) tryWithLock(c context.Context, clientID string, fn func(context.Context) error) error {
- key := fmt.Sprintf("datastore_cache_entry_%s", e.keyHash())
- return memlock.TryWithLock(c, key, clientID, fn)
+func (e *entry) lockKey() string {
+ return "datastore_cache_entry_" + e.keyHash()
}
// managerShardStats are per-shard stats kept by manager runs.
« no previous file with comments | « appengine/datastorecache/lock.go ('k') | appengine/datastorecache/util_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698