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

Side by Side Diff: appengine/gaeconfig/cache.go

Issue 2576923003: Implement config service cache on top of datastore (Closed)
Patch Set: Created 4 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 | appengine/gaeconfig/default.go » ('j') | appengine/gaeconfig/ds.go » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package gaeconfig 5 package gaeconfig
6 6
7 import ( 7 import (
8 "encoding/hex" 8 "encoding/hex"
9 "time" 9 "time"
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 log.ErrorKey: err, 74 log.ErrorKey: err,
75 "key": k, 75 "key": k,
76 }.Warningf(c, "Failed to cache config.") 76 }.Warningf(c, "Failed to cache config.")
77 } 77 }
78 78
79 // Return the loaded value. 79 // Return the loaded value.
80 return v, nil 80 return v, nil
81 81
82 default: 82 default:
83 // Unknown memcache error. 83 // Unknown memcache error.
84 » » » » log.Fields{ 84 » » » » return nil, errors.Annotate(err).Reason("failed to load memcache config").Err()
85 » » » » » log.ErrorKey: err,
86 » » » » » "key": k,
87 » » » » }.Warningf(c, "Failed to decode memcached config .")
88 » » » » return l(c, key, nil)
89 } 85 }
90 }, 86 },
91 } 87 }
92 } 88 }
93 89
94 func memcacheKey(key *caching.Key) string { return hex.EncodeToString(key.ParamH ash()) } 90 func memcacheKey(key *caching.Key) string { return hex.EncodeToString(key.ParamH ash()) }
OLDNEW
« no previous file with comments | « no previous file | appengine/gaeconfig/default.go » ('j') | appengine/gaeconfig/ds.go » ('J')

Powered by Google App Engine
This is Rietveld 408576698