destination storage refactoring started

This commit is contained in:
Radu Ioan Fericean
2016-07-18 21:51:42 +03:00
parent 8cc273b2f1
commit db50767a99
5 changed files with 38 additions and 54 deletions

View File

@@ -115,15 +115,15 @@ func CacheGet(key string) (v interface{}, err error) {
}
// Appends to an existing slice in the cache key
func CachePush(key string, value string) {
func CachePush(key string, values ...string) {
if !transactionLock {
mux.Lock()
defer mux.Unlock()
}
if !transactionON {
cache.Append(key, value)
cache.Append(key, values...)
} else {
transactionBuffer = append(transactionBuffer, &transactionItem{key: key, value: value, kind: KIND_ADP})
transactionBuffer = append(transactionBuffer, &transactionItem{key: key, value: values, kind: KIND_ADP})
}
}