batchFromQueue method

void batchFromQueue()

Implementation

void batchFromQueue() {
  // Flagship.logger(Level.DEBUG, label + " : process to send batch");
  cronTimer.reset();
  var listOfHitsToSend =
      fsPool.extractXElementFromQueue(configTracking.poolMaxSize);
  if (listOfHitsToSend.isNotEmpty) {
    // in periodic strategy will cache the list
    if (this.configTracking.batchStrategy ==
        BatchCachingStrategy.BATCH_PERIODIC_CACHING) {
      // Call the interface to store the entire loop before send it
      this.fsCacheHit.cacheHits(fsPool.hitsFromListToMap(listOfHitsToSend));
    }
    // Send batch
    sendBatch(listOfHitsToSend);
  } else {
    cronTimer.start();
  }
}