Commit f66a2b18 by Vladislav

fix use ProcessCallLimitedAPI

1 parent 49bb42cc
<?php <?php
namespace App\Service\Handlers; namespace App\Service\Handlers;
use App\Jobs\ProcessCallLimitedAPI;
use App\Service\Contract\API; use App\Service\Contract\API;
use App\Service\Contract\APIRequest; use App\Service\Contract\APIRequest;
...@@ -31,7 +32,7 @@ class AdsHandler ...@@ -31,7 +32,7 @@ class AdsHandler
if ($offset) { if ($offset) {
$this->request->next($offset); $this->request->next($offset);
dispatch( new ProcessCallLimitedAPI($this->request)); dispatch(new ProcessCallLimitedAPI($this->request));
} }
$this->request->handle($this->response); $this->request->handle($this->response);
......
...@@ -11,7 +11,7 @@ namespace App\Service\Requests; ...@@ -11,7 +11,7 @@ namespace App\Service\Requests;
class DirectRequest extends APIRequest class DirectRequest extends APIRequest
{ {
CONST MAX_COUNT = 10000; protected $limit = 10000;
protected $max_count = -1; protected $max_count = -1;
private $url; private $url;
...@@ -32,11 +32,11 @@ class DirectRequest extends APIRequest ...@@ -32,11 +32,11 @@ class DirectRequest extends APIRequest
{ {
if (!isset($this->params['Page'])) { if (!isset($this->params['Page'])) {
$this->params['Page'] = [ $this->params['Page'] = [
'Limit' => self::MAX_COUNT, 'Limit' => $this->limit,
'Offset' => $offset 'Offset' => $offset
]; ];
} }
$this->params['Page']['Limit'] = self::MAX_COUNT; $this->params['Page']['Limit'] = $this->limit;
$this->params['Page']['Offset'] = $offset; $this->params['Page']['Offset'] = $offset;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!