Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Письменов Дмитрий Иванович
/
yourroomads
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d183c7e5
authored
Jun 23, 2021
by
Евгений
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Улучшение #19474
Синхронизация фраз и групп
1 parent
d2a9fc28
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
4 deletions
app/Jobs/ProcessCallAPI.php
app/Service/Requests/Direct/AddAdGroups.php
app/Jobs/ProcessCallAPI.php
View file @
d183c7e
...
...
@@ -57,7 +57,7 @@ class ProcessCallAPI implements ShouldQueue
$maxObjects
=
$limits
->
countObjectsLimitReserve
(
$this
->
api
,
$limit
);
}
if
(
$maxObjects
and
$maxObjects
!==
$limits
::
NAN
&&
$this
->
api
->
getObjectsCount
()
>
$maxObjects
)
{
if
(
$maxObjects
&&
$maxObjects
!==
$limits
::
NAN
&&
$this
->
api
->
getObjectsCount
()
>
$maxObjects
)
{
//те на которые не хватило баллов помещаем в очередь
if
(
$apiR
=
$this
->
api
->
slice
(
$maxObjects
))
{
dispatch
(
new
ProcessCallLimitedAPI
(
$apiR
))
->
onQueue
(
'limits'
);
...
...
@@ -68,8 +68,6 @@ class ProcessCallAPI implements ShouldQueue
$handler
->
checkError
(
$response
);
$limits
->
acceptRezerv
(
$this
->
limitId
,
new
HeaderLimits
(
$response
->
headers
()));
//TODO: обработать результат.
// если не хватило баллов на все что хотели запросить, то в очередь отправляем новый запрос на получение новых данных
$handler
->
handle
(
$response
);
}
catch
(
\Exception
$e
)
{
//TODO: надо отдельно выделить ошибки вызовов, за которые списываются баллы
...
...
app/Service/Requests/Direct/AddAdGroups.php
View file @
d183c7e
...
...
@@ -23,7 +23,6 @@ class AddAdGroups extends DirectRequest
public
function
call
(
$params
=
null
)
{
$this
->
requestPrepare
(
$params
);
Log
::
debug
(
$this
->
getParams
());
$process
=
new
ProcessCallLimitedAPI
(
$this
);
dispatch
(
$process
)
->
onQueue
(
'limits'
);
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment