async function refreshAthletes(
  shouldRefreshActivities = false,
  findArgs = [{}],
) {
  const athletes = await Athlete.find(...findArgs);
  for (let i = 0; i < athletes.length; i += 1) {
    const athlete = athletes[i];
    // eslint-disable-next-line
    const updatedAthlete = await refreshAthleteProfile(athlete);
    if (updatedAthlete && shouldRefreshActivities) {
      // eslint-disable-next-line
      await refreshAthleteActivities(
        updatedAthlete,
        false,
        process.env.SHOULD_REFRESH_VERBOSE,
      );
    }
  }
  console.log(`Updated ${athletes.length} athletes`);
}
/**
 * Query athletes collection then refresh since last_updated
 *
 * @param {Bool} shouldRefreshActivities Default to false, i.e. update profile
 * @param {Multiple} findArgs Args to pass to http://mongoosejs.com/docs/api.html#find_find
 */
Query athletes collection then refresh since last_updated
@param {Bool} shouldRefreshActivities Default to false, i.e.
Query athletes collection then refresh since last_updated @param { Bool } shouldRefreshActivities Default to false i . e .
async function refreshAthletes(
  shouldRefreshActivities = false,
  findArgs = [{}],
) {
  const athletes = await Athlete.find(...findArgs);
  for (let i = 0; i < athletes.length; i += 1) {
    const athlete = athletes[i];
    const updatedAthlete = await refreshAthleteProfile(athlete);
    if (updatedAthlete && shouldRefreshActivities) {
      await refreshAthleteActivities(
        updatedAthlete,
        false,
        process.env.SHOULD_REFRESH_VERBOSE,
      );
    }
  }
  console.log(`Updated ${athletes.length} athletes`);
}
async function refreshAthletes ( shouldRefreshActivities = false , findArgs = [ { } ] , ) { const athletes = await Athlete . find ( ... findArgs ) ; for ( let i = 0 ; i < athletes . length ; i += 1 ) { const athlete = athletes [ i ] ; const updatedAthlete = await refreshAthleteProfile ( athlete ) ; if ( updatedAthlete && shouldRefreshActivities ) { await refreshAthleteActivities ( updatedAthlete , false , process . env . SHOULD_REFRESH_VERBOSE , ) ; } } console . log ( ` ${ athletes . length } ` ) ; }
Query athletes collection then refresh since last_updated
 @param {Bool} shouldRefreshActivities Default to false, i.e.
Query athletes collection then refresh since last_updated @param { Bool } shouldRefreshActivities Default to false i . e .
// eslint-disable-next-line // eslint-disable-next-line