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

Side by Side Diff: filter/dscache/ds.go

Issue 1516173002: Fix error message from KeyForObj when passing an invalid struct. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: remove accidental extra test Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | filter/dscache/support.go » ('j') | service/datastore/pls.go » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package dscache 5 package dscache
6 6
7 import ( 7 import (
8 "time" 8 "time"
9 9
10 ds "github.com/luci/gae/service/datastore" 10 ds "github.com/luci/gae/service/datastore"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 } else { 81 } else {
82 p.lme.Assign(i, err) 82 p.lme.Assign(i, err)
83 if err != ds.ErrNoSuchEntity { 83 if err != ds.ErrNoSuchEntity {
84 return // aka continue to the next entry 84 return // aka continue to the next entry
85 } 85 }
86 } 86 }
87 87
88 if toSave != nil { 88 if toSave != nil {
89 if shouldSave { // save 89 if shouldSave { // save
90 » » » » » expSecs := metas.GetMetaDefault(i, Cache ExpirationMeta, CacheTimeSeconds).(int64) 90 » » » » » mg := metas.GetSingle(i)
91 » » » » » expSecs := ds.GetMetaDefault(mg, CacheEx pirationMeta, CacheTimeSeconds).(int64)
91 toSave.SetFlags(uint32(ItemHasData)) 92 toSave.SetFlags(uint32(ItemHasData))
92 toSave.SetExpiration(time.Duration(expSe cs) * time.Second) 93 toSave.SetExpiration(time.Duration(expSe cs) * time.Second)
93 toSave.SetValue(data) 94 toSave.SetValue(data)
94 } else { 95 } else {
95 // Set a lock with an infinite timeout. No one else should try to 96 // Set a lock with an infinite timeout. No one else should try to
96 // serialize this item to memcache until something Put/Delete's it. 97 // serialize this item to memcache until something Put/Delete's it.
97 toSave.SetFlags(uint32(ItemHasLock)) 98 toSave.SetFlags(uint32(ItemHasLock))
98 toSave.SetExpiration(0) 99 toSave.SetExpiration(0)
99 toSave.SetValue(nil) 100 toSave.SetValue(nil)
100 } 101 }
(...skipping 29 matching lines...) Expand all
130 if err == nil { 131 if err == nil {
131 err = txnState.apply(d.supportContext) 132 err = txnState.apply(d.supportContext)
132 } 133 }
133 return err 134 return err
134 }, opts) 135 }, opts)
135 if err == nil { 136 if err == nil {
136 txnState.release(d.supportContext) 137 txnState.release(d.supportContext)
137 } 138 }
138 return err 139 return err
139 } 140 }
OLDNEW
« no previous file with comments | « no previous file | filter/dscache/support.go » ('j') | service/datastore/pls.go » ('J')

Powered by Google App Engine
This is Rietveld 408576698