Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
198
Issues
198
List
Boards
Labels
Service Desk
Milestones
Merge Requests
27
Merge Requests
27
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
38602fa9
Commit
38602fa9
authored
29 minutes ago
by
Ben Hayward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more feedback
parent
0cdeb613
feat/rate-limit-boost-475
1 merge request
!251
[Sprint/InterestingIguana](feat): Offchain boost rate limiting #475
Pipeline
#74210451
failed with stages
in 4 minutes and 35 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
11 deletions
+30
-11
ElasticRepository.php
Core/Boost/Network/ElasticRepository.php
+3
-3
ElasticRepositorySpec.php
Spec/Core/Boost/Network/ElasticRepositorySpec.php
+1
-0
ManagerSpec.php
Spec/Core/Boost/Network/ManagerSpec.php
+26
-8
No files found.
Core/Boost/Network/ElasticRepository.php
View file @
38602fa9
...
...
@@ -72,7 +72,7 @@ class ElasticRepository
$must
[]
=
[
'term'
=>
[
'owner_guid'
=>
$opts
[
'owner_guid'
],
]
]
,
];
}
...
...
@@ -94,8 +94,8 @@ class ElasticRepository
if
(
$opts
[
'offchain'
])
{
$must
[]
=
[
'term'
=>
[
'token_method'
=>
'offchain'
]
'token_method'
=>
'offchain'
,
]
,
];
}
...
...
This diff is collapsed.
Click to expand it.
Spec/Core/Boost/Network/ElasticRepositorySpec.php
View file @
38602fa9
...
...
@@ -65,4 +65,5 @@ class ElasticRepositorySpec extends ObjectBehavior
$this
->
add
(
$boost
)
->
shouldReturn
(
true
);
}
}
This diff is collapsed.
Click to expand it.
Spec/Core/Boost/Network/ManagerSpec.php
View file @
38602fa9
...
...
@@ -273,12 +273,12 @@ class ManagerSpec extends ObjectBehavior
function
it_should_check_if_the_entity_was_already_boosted
(
Boost
$boost
)
{
$this
->
elasticRepository
->
getList
([
"hydrate"
=>
true
,
"useElastic"
=>
true
,
"state"
=>
"review"
,
"type"
=>
"newsfeed"
,
"entity_guid"
=>
"123"
,
"limit"
=>
1
'hydrate'
=>
true
,
'useElastic'
=>
true
,
'state'
=>
'review'
,
'type'
=>
'newsfeed'
,
'entity_guid'
=>
'123'
,
'limit'
=>
1
])
->
shouldBeCalled
()
->
willReturn
(
new
Response
([
$boost
],
''
));
...
...
@@ -300,7 +300,16 @@ class ManagerSpec extends ObjectBehavior
function
it_should_request_offchain_boosts
(
Boost
$boost
)
{
$this
->
elasticRepository
->
getList
([
"hydrate"
=>
true
,
"useElastic"
=>
true
,
"state"
=>
"review"
,
"type"
=>
"newsfeed"
,
"limit"
=>
10
,
"order"
=>
"desc"
,
"offchain"
=>
true
,
"owner_guid"
=>
"123"
])
$this
->
elasticRepository
->
getList
([
"hydrate"
=>
true
,
"useElastic"
=>
true
,
"state"
=>
"review"
,
"type"
=>
"newsfeed"
,
"limit"
=>
10
,
"order"
=>
"desc"
,
"offchain"
=>
true
,
"owner_guid"
=>
"123"
])
->
shouldBeCalled
()
->
willReturn
(
new
Response
([
$boost
],
''
));
...
...
@@ -363,7 +372,16 @@ class ManagerSpec extends ObjectBehavior
}
function
runThroughGetList
(
$boost
,
$existingBoosts
)
{
$this
->
elasticRepository
->
getList
([
"hydrate"
=>
true
,
"useElastic"
=>
true
,
"state"
=>
"review"
,
"type"
=>
"newsfeed"
,
"limit"
=>
10
,
"order"
=>
"desc"
,
"offchain"
=>
true
,
"owner_guid"
=>
"123"
])
$this
->
elasticRepository
->
getList
([
"hydrate"
=>
true
,
"useElastic"
=>
true
,
"state"
=>
"review"
,
"type"
=>
"newsfeed"
,
"limit"
=>
10
,
"order"
=>
"desc"
,
"offchain"
=>
true
,
"owner_guid"
=>
"123"
])
->
shouldBeCalled
()
->
willReturn
(
new
Response
(
$existingBoosts
,
''
));
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment