BryanDonovan/node-cache-manager — pull request #9 by elliotttf (2014-09-10 14:28:46+00:00)
Title: Use call instead of apply for cached results.

In the cache manager's work callback it is assumed that `work_args` is an array of `[ err, result ]`; however, the underlaying cache engine's `set` method is called with the full array of work args, not just the result. This results in the cache value being stored as an array of `[ err, result ]`. I don't believe that this is desirable but perhaps I'm missing some of the intent here. This went undetected in testing because the cached result was calling back with `result`: the previously stored array.

This PR ensures that the underlaying cache engine is storing only the cacheable result and not the error parameter and that was returned by the `work` method.