async function doIngestActivity({
  subargs,
  dryRun: isDryRun = false,
}) {
  if (!checkNumArgs(subargs, 2, 'ingest <activityId> <[--dry-run]>')) {
    return;
  }

  const activityId = subargs[1];

  // Get doc from queue and check eligibility
  const findQuery = { activityId };
  const queueDoc = await QueueActivity.findOne(findQuery);
  if (!queueDoc) {
    console.warn(`QueueActivity ${activityId} was not found in the QueueActivity collection.`);
    return;
  }

  await processQueueActivity(queueDoc, findQuery, isDryRun);
  console.log(queueDoc.toJSON());
  if (isDryRun) {
    console.log('**This was a dry run; no DB write operations.**');
  }
}
/**
 * Ingest an enqueued activity to the activities collection
 *
 * @param {Integer} args.subargs[1] Activity ID
 * @param {String} args.dryRun If true, will process without DB updates
 */
Ingest an enqueued activity to the activities collection
@param {Integer} args.subargs[1] Activity ID
@param {String} args.dryRun If true, will process without DB updates
Ingest an enqueued activity to the activities collection @param { Integer } args . subargs [ 1 ] Activity ID @param { String } args . dryRun If true will process without DB updates
async function doIngestActivity({
  subargs,
  dryRun: isDryRun = false,
}) {
  if (!checkNumArgs(subargs, 2, 'ingest <activityId> <[--dry-run]>')) {
    return;
  }
  const activityId = subargs[1];
  const findQuery = { activityId };
  const queueDoc = await QueueActivity.findOne(findQuery);
  if (!queueDoc) {
    console.warn(`QueueActivity ${activityId} was not found in the QueueActivity collection.`);
    return;
  }
  await processQueueActivity(queueDoc, findQuery, isDryRun);
  console.log(queueDoc.toJSON());
  if (isDryRun) {
    console.log('**This was a dry run; no DB write operations.**');
  }
}
async function doIngestActivity ( { subargs , dryRun : isDryRun = false , } ) { if ( ! checkNumArgs ( subargs , 2 , 'ingest <activityId> <[--dry-run]>' ) ) { return ; } const activityId = subargs [ 1 ] ; const findQuery = { activityId } ; const queueDoc = await QueueActivity . findOne ( findQuery ) ; if ( ! queueDoc ) { console . warn ( ` ${ activityId } ` ) ; return ; } await processQueueActivity ( queueDoc , findQuery , isDryRun ) ; console . log ( queueDoc . toJSON ( ) ) ; if ( isDryRun ) { console . log ( '**This was a dry run; no DB write operations.**' ) ; } }
Ingest an enqueued activity to the activities collection
 @param {Integer} args.subargs[1] Activity ID
 @param {String} args.dryRun If true, will process without DB updates
Ingest an enqueued activity to the activities collection @param { Integer } args . subargs [ 1 ] Activity ID @param { String } args . dryRun If true will process without DB updates
// Get doc from queue and check eligibility