Commit 9a774666 authored by Mark Harding's avatar Mark Harding

(chore): change offset and ttls for boost rotator

parent 1519f7fe
No related merge requests found
Pipeline #70994261 passed with stages
in 9 minutes and 26 seconds
......@@ -94,6 +94,7 @@ class feed implements Interfaces\Api
$feedSyncEntity
->setGuid((string) $boost->getGuid())
->setOwnerGuid((string) $boost->getOwnerGuid())
->setTimestamp($boost->getCreatedTimestamp())
->setUrn(new Urn("urn:boost:{$boost->getType()}:{$boost->getGuid()}"));
$boosts[] = $feedSyncEntity;
......@@ -101,7 +102,17 @@ class feed implements Interfaces\Api
// $boosts = iterator_to_array($iterator, false);
$next = $iterator->getOffset();
$cacher->set(Core\Session::getLoggedinUser()->guid . ':boost-offset-rotator', $next);
if (isset($boosts[2])) { // Always offset to 3rd in list
$next = $boosts[2]->getTimestamp();
}
$ttl = 1800; // 30 minutes
if (($next / 1000) < strtotime('48 hours ago')) {
$ttl = 300; // 5 minutes;
}
$cacher->set(Core\Session::getLoggedinUser()->guid . ':boost-offset-rotator', $next, $ttl);
break;
case 'content':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment