Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Commits on Source (2)
updated to only apply to active boosts and requests
· d735c585
Ben
authored
Aug 06, 2019
d735c585
Fixing and updating tests
· ac58cb96
Ben
authored
Aug 06, 2019
ac58cb96
Hide whitespace changes
Inline
Side-by-side
Core/Boost/Network/ElasticRepository.php
View file @
ac58cb96
...
...
@@ -108,7 +108,7 @@ class ElasticRepository
$sort
=
[
'@timestamp'
=>
'asc'
];
}
if
(
$opts
[
'state'
]
===
'approved'
||
$opts
[
'state'
]
===
'review'
)
{
if
(
$opts
[
'state'
]
===
'approved'
||
$opts
[
'state'
]
===
'review'
||
$opts
[
'state'
]
===
'active'
)
{
$must_not
[]
=
[
'exists'
=>
[
'field'
=>
'@completed'
,
...
...
Core/Boost/Network/Manager.php
View file @
ac58cb96
...
...
@@ -57,14 +57,14 @@ class Manager
'state'
=>
null
,
],
$opts
);
if
(
$opts
[
'state'
]
==
'review'
)
{
if
(
$opts
[
'state'
]
==
'review'
||
$opts
[
'state'
]
==
'active'
)
{
$opts
[
'useElastic'
]
=
true
;
}
if
(
$opts
[
'useElastic'
])
{
$response
=
$this
->
elasticRepository
->
getList
(
$opts
);
if
(
$opts
[
'state'
]
===
'review'
)
{
if
(
$opts
[
'state'
]
===
'review'
||
$opts
[
'state'
]
===
'active'
)
{
$opts
[
'guids'
]
=
array_map
(
function
(
$boost
)
{
return
$boost
->
getGuid
();
},
$response
->
toArray
());
...
...
@@ -200,6 +200,7 @@ class Manager
public
function
getOffchainBoosts
(
$boost
,
$limit
=
10
)
{
$existingBoosts
=
$this
->
getList
([
'useElastic'
=>
true
,
'state'
=>
'active'
,
'type'
=>
$boost
->
getType
(),
'limit'
=>
$limit
,
'order'
=>
'desc'
,
...
...
Spec/Core/Boost/Network/ManagerSpec.php
View file @
ac58cb96
...
...
@@ -303,7 +303,7 @@ class ManagerSpec extends ObjectBehavior
$this
->
elasticRepository
->
getList
([
"hydrate"
=>
true
,
"useElastic"
=>
true
,
"state"
=>
"
review
"
,
"state"
=>
"
active
"
,
"type"
=>
"newsfeed"
,
"limit"
=>
10
,
"order"
=>
"desc"
,
...
...
@@ -375,7 +375,7 @@ class ManagerSpec extends ObjectBehavior
$this
->
elasticRepository
->
getList
([
"hydrate"
=>
true
,
"useElastic"
=>
true
,
"state"
=>
"
review
"
,
"state"
=>
"
active
"
,
"type"
=>
"newsfeed"
,
"limit"
=>
10
,
"order"
=>
"desc"
,
...
...