services/db.js
function batch(ops, testCacheEnabled) {
  const cacheEnabled = testCacheEnabled || CACHE_ENABLED;

  return postgres.batch(ops)
    .then((res) => {
      if (cacheEnabled) {
        return redis.batch(ops).then(() => res);
      }

      return res;
    });
}
function batch(ops, testCacheEnabled) {
  const cacheEnabled = testCacheEnabled || CACHE_ENABLED;

  return postgres.batch(ops)
    .then((res) => {
      if (cacheEnabled) {
        return redis.batch(ops).then(() => res);
      }

      return res;
    });
}
function batch ( ops , testCacheEnabled ) { const cacheEnabled = testCacheEnabled || CACHE_ENABLED ; return postgres . batch ( ops ) . then ( ( res ) => { if ( cacheEnabled ) { return redis . batch ( ops ) . then ( ( ) => res ) ; } return res ; } ) ; }
Process a whole group of saves

@param  {Array} ops
@param  {Boolean} testCacheEnabled used for tests
@return {Promise}
Process a whole group of saves