lib/impl/dataSources/updateCache.js
function updateValidAndInvalidDataSources(dataSourcesToSplit, currentInvalidDataSources) {
  logger.debug("dataSourcesToSplit", dataSourcesToSplit);
  currentInvalidDataSources = currentInvalidDataSources || [];
  var validInvalid = _.partition(dataSourcesToSplit, function(dataSourceUpdateData) {
    if (dataSourceUpdateData) {
      return !dataSourceUpdateData.error;
    }
    return true;
  });

  var validDataSources = validInvalid[0];

  //Updating any data sources that are no longer valid
  var invalidDataSources = _.union(validInvalid[1], currentInvalidDataSources);

  return {
    valid: validDataSources,
    invalid: invalidDataSources
  };
}
function updateValidAndInvalidDataSources(dataSourcesToSplit, currentInvalidDataSources) {
  logger.debug("dataSourcesToSplit", dataSourcesToSplit);
  currentInvalidDataSources = currentInvalidDataSources || [];
  var validInvalid = _.partition(dataSourcesToSplit, function(dataSourceUpdateData) {
    if (dataSourceUpdateData) {
      return !dataSourceUpdateData.error;
    }
    return true;
  });

  var validDataSources = validInvalid[0];

  //Updating any data sources that are no longer valid
  var invalidDataSources = _.union(validInvalid[1], currentInvalidDataSources);

  return {
    valid: validDataSources,
    invalid: invalidDataSources
  };
}
function updateValidAndInvalidDataSources ( dataSourcesToSplit , currentInvalidDataSources ) { logger . debug ( "dataSourcesToSplit" , dataSourcesToSplit ) ; currentInvalidDataSources = currentInvalidDataSources || [ ] ; var validInvalid = _ . partition ( dataSourcesToSplit , function ( dataSourceUpdateData ) { if ( dataSourceUpdateData ) { return ! dataSourceUpdateData . error ; } return true ; } ) ; var validDataSources = validInvalid [ 0 ] ; //Updating any data sources that are no longer valid var invalidDataSources = _ . union ( validInvalid [ 1 ] , currentInvalidDataSources ) ; return { valid : validDataSources , invalid : invalidDataSources } ; }
Splitting Data Sources Into Invalid And Valid Data Sources.
@param dataSourcesToSplit
@param currentInvalidDataSources
@returns {{valid, invalid: Array}}
Splitting Data Sources Into Invalid And Valid Data Sources .