function forward() {
  let raddec = raddecs.shift();
  let id = raddec.timestamp + '-' + raddec.transmitterId + '-' +
           raddec.transmitterIdType;

  isForwardingRaddecs = true;

  // Create flat raddec and tweak properties for Elasticsearch
  let esRaddec = raddec.toFlattened(raddecOptions);
  esRaddec.timestamp = new Date(esRaddec.timestamp).toISOString();

  let params = {
      index: ES_INDEX,
      type: ES_MAPPING_TYPE,
      id: id,
      body: esRaddec
  };
  client.create(params, {}, function(err, result) {
    let isMoreRaddecs = (raddecs.length > 0);
    if(err) {
      tessel.led[0].on();
      tessel.led[0].off();
    }
    if(isMoreRaddecs) {
      forward();
    }
    else {
      isForwardingRaddecs = false;
    }
  });
}
/**
 * Forward the next raddec in the queue to Elasticsearch, repeat.
 */
Forward the next raddec in the queue to Elasticsearch, repeat.
Forward the next raddec in the queue to Elasticsearch repeat .
function forward() {
  let raddec = raddecs.shift();
  let id = raddec.timestamp + '-' + raddec.transmitterId + '-' +
           raddec.transmitterIdType;
  isForwardingRaddecs = true;
  let esRaddec = raddec.toFlattened(raddecOptions);
  esRaddec.timestamp = new Date(esRaddec.timestamp).toISOString();
  let params = {
      index: ES_INDEX,
      type: ES_MAPPING_TYPE,
      id: id,
      body: esRaddec
  };
  client.create(params, {}, function(err, result) {
    let isMoreRaddecs = (raddecs.length > 0);
    if(err) {
      tessel.led[0].on();
      tessel.led[0].off();
    }
    if(isMoreRaddecs) {
      forward();
    }
    else {
      isForwardingRaddecs = false;
    }
  });
}
function forward ( ) { let raddec = raddecs . shift ( ) ; let id = raddec . timestamp + '-' + raddec . transmitterId + '-' + raddec . transmitterIdType ; isForwardingRaddecs = true ; let esRaddec = raddec . toFlattened ( raddecOptions ) ; esRaddec . timestamp = new Date ( esRaddec . timestamp ) . toISOString ( ) ; let params = { index : ES_INDEX , type : ES_MAPPING_TYPE , id : id , body : esRaddec } ; client . create ( params , { } , function ( err , result ) { let isMoreRaddecs = ( raddecs . length > 0 ) ; if ( err ) { tessel . led [ 0 ] . on ( ) ; tessel . led [ 0 ] . off ( ) ; } if ( isMoreRaddecs ) { forward ( ) ; } else { isForwardingRaddecs = false ; } } ) ; }
Forward the next raddec in the queue to Elasticsearch, repeat.
Forward the next raddec in the queue to Elasticsearch repeat .
// Create flat raddec and tweak properties for Elasticsearch