Пример #1
0
 /**
  * Runs the price batch update process for selected market types and regions. This is done with parallel async CURL
  * calls and DB submission + committing in batches.
  *
  * @param array $typeIds of the market types
  * @param array $regionIds of the marget regions
  * @param bool $verbose whether the items currently being updated should be printed to console
  *
  * @return void
  */
 public function runPriceBatch(array $typeIds, array $regionIds, $verbose = false)
 {
     $this->verboseBatch = $verbose;
     foreach (array_unique($regionIds) as $regionId) {
         $this->endpointHandler->getMultiMarketOrders($typeIds, $regionId, function (Response $response) {
             $this->processOrderResponse($response);
         }, function (Response $response) {
             print_r($response);
             //TODO
         }, false);
         //overwrite existing array to ensure cleanup of potentially unprocessed single responses
         $this->orderResponseBuffer = [];
     }
     $this->commitSql();
 }