| OLD | NEW |
| 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 prod | 5 package prod |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "time" | 8 "time" |
| 9 | 9 |
| 10 mc "github.com/luci/gae/service/memcache" | 10 mc "github.com/luci/gae/service/memcache" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 return nil | 134 return nil |
| 135 } | 135 } |
| 136 | 136 |
| 137 func (m mcImpl) CompareAndSwapMulti(items []mc.Item, cb mc.RawCB) error { | 137 func (m mcImpl) CompareAndSwapMulti(items []mc.Item, cb mc.RawCB) error { |
| 138 return doCB(memcache.CompareAndSwapMulti(m.Context, mcMF2R(items)), cb) | 138 return doCB(memcache.CompareAndSwapMulti(m.Context, mcMF2R(items)), cb) |
| 139 } | 139 } |
| 140 | 140 |
| 141 func (m mcImpl) Increment(key string, delta int64, initialValue *uint64) (uint64
, error) { | 141 func (m mcImpl) Increment(key string, delta int64, initialValue *uint64) (uint64
, error) { |
| 142 if initialValue == nil { | 142 if initialValue == nil { |
| 143 return memcache.IncrementExisting(m.Context, key, delta) | 143 return memcache.IncrementExisting(m.Context, key, delta) |
| 144 } else { | |
| 145 return memcache.Increment(m.Context, key, delta, *initialValue) | |
| 146 } | 144 } |
| 145 return memcache.Increment(m.Context, key, delta, *initialValue) |
| 147 } | 146 } |
| 148 | 147 |
| 149 func (m mcImpl) Flush() error { | 148 func (m mcImpl) Flush() error { |
| 150 return memcache.Flush(m.Context) | 149 return memcache.Flush(m.Context) |
| 151 } | 150 } |
| 152 | 151 |
| 153 func (m mcImpl) Stats() (*mc.Statistics, error) { | 152 func (m mcImpl) Stats() (*mc.Statistics, error) { |
| 154 stats, err := memcache.Stats(m.Context) | 153 stats, err := memcache.Stats(m.Context) |
| 155 if err != nil { | 154 if err != nil { |
| 156 return nil, err | 155 return nil, err |
| 157 } | 156 } |
| 158 return (*mc.Statistics)(stats), nil | 157 return (*mc.Statistics)(stats), nil |
| 159 } | 158 } |
| OLD | NEW |