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

Unified Diff: impl/memory/memcache.go

Issue 1269113005: A transparent cache for datastore, backed by memcache. (Closed) Base URL: https://github.com/luci/gae.git@add_meta
Patch Set: add test for per-model expiration Created 5 years, 4 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
Index: impl/memory/memcache.go
diff --git a/impl/memory/memcache.go b/impl/memory/memcache.go
index 4a38c026a0fc3a06d9859e2d431f86fb8c5fea09..1892129f024c5b2da307fc99e90c41cd5b43b3e6 100644
--- a/impl/memory/memcache.go
+++ b/impl/memory/memcache.go
@@ -50,7 +50,13 @@ func (m *mcItem) SetExpiration(exp time.Duration) mc.Item {
}
func (m *mcItem) SetAll(other mc.Item) {
- *m = *other.(*mcItem)
+ if other == nil {
+ *m = mcItem{key: m.key}
+ } else {
+ k := m.key
+ *m = *other.(*mcItem)
+ m.key = k
+ }
}
type mcDataItem struct {
@@ -200,7 +206,7 @@ func (m *memcacheImpl) AddMulti(items []mc.Item, cb mc.RawCB) error {
m.data.setItemLocked(now, itm)
return nil
} else {
- return (mc.ErrNotStored)
+ return mc.ErrNotStored
}
})
return nil

Powered by Google App Engine
This is Rietveld 408576698