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)
(fix): $cacheKey should consider quality and rating
· c34608ff
Marcelo Rivera
authored
Jul 19, 2019
c34608ff
(fix): ios and new users check should be done before checking cache
· 3f3f52ec
Marcelo Rivera
authored
Jul 19, 2019
3f3f52ec
Hide whitespace changes
Inline
Side-by-side
Controllers/api/v2/boost/fetch/campaigns.php
View file @
3f3f52ec
...
...
@@ -58,15 +58,6 @@ class campaigns implements Interfaces\Api
$limit
=
500
;
}
$cacher
=
Core\Data\cache\factory
::
build
(
'Redis'
);
$cacheKey
=
Core\Session
::
getLoggedinUser
()
->
guid
.
':boost-offset-rotator:'
.
$type
;
// $offset = $cacher->get($cacheKey);
$offset
=
null
;
if
(
!
$offset
)
{
$offset
=
0
;
}
// Options specific to newly created users (<=1 hour) and iOS users
if
(
$platform
===
'ios'
)
{
...
...
@@ -77,6 +68,17 @@ class campaigns implements Interfaces\Api
$quality
=
75
;
}
$userGuid
=
Core\Session
::
getLoggedinUser
()
->
guid
;
$cacher
=
Core\Data\cache\factory
::
build
(
'Redis'
);
$cacheKey
=
"
{
$userGuid
}
:boost-offset-rotator:
{
$type
}
:
{
$quality
}
:
{
$rating
}
"
;
// $offset = $cacher->get($cacheKey);
$offset
=
null
;
if
(
!
$offset
)
{
$offset
=
0
;
}
/** @var Boost\Campaigns\Manager $manager */
$manager
=
Di
::
_
()
->
get
(
'Boost\Campaigns\Manager'
);
...
...