jpodwys / cache-service

A tiered caching solution for JavaScript.
MIT License
12 stars 6 forks source link

mset() returns +1 item in response #16

Open thanpolas opened 8 years ago

thanpolas commented 8 years ago

when executing an mset() with three key/value pairs, the response will be an array of 4 items with OK.

Using redis store, i'd expect to get 3 items

jpodwys commented 8 years ago

It's possible that this is actually an issue with cache-service-redis. I'll need to do more digging, but cache-service usually just passes through the data the children caches return. Also, redis is known to return OK whereas cache-service is not.

JaredReisinger commented 7 years ago

Actually, as currently written, .mset() simply passes the provided callback to the last cache module's .mset() implmentation. Modules [0] through [n-2] aren't passed a callback at all; those responses/errors are completely lost. Both .del() and .flush() are handled the same way. Conversely, .set() passes the provided callback to the first cache module's .set() implementation, and the responses from modules [1] through [n-1] are lost.