Browse Source

upgrade Yggverse\Cache\Memory API to v0.3.0

yggdrasil-0.4.7
ghost 1 year ago
parent
commit
c1dc5030e6
  1. 3
      src/public/index.php
  2. 2
      src/public/peer.php

3
src/public/index.php

@ -20,7 +20,7 @@ try {
// Connect memcached // Connect memcached
try { try {
$memory = new Yggverse\Cache\Memory(MEMCACHED_HOST, MEMCACHED_PORT, MEMCACHED_NAMESPACE, MEMCACHED_TIMEOUT); $memory = new Yggverse\Cache\Memory(MEMCACHED_HOST, MEMCACHED_PORT, MEMCACHED_NAMESPACE, MEMCACHED_TIMEOUT + time());
} catch(Exception $e) { } catch(Exception $e) {
@ -82,6 +82,7 @@ foreach ($calendar->getNodes() as $day => $node) {
break; break;
case 'traffic': case 'traffic':
// @TODO improve cache timing
$timeFrom = strtotime(sprintf('%s-%s-%s 00:00', date('Y', $requestTime), date('n', $requestTime), $day)); $timeFrom = strtotime(sprintf('%s-%s-%s 00:00', date('Y', $requestTime), date('n', $requestTime), $day));
$timeTo = strtotime('+1 day', strtotime(sprintf('%s-%s-%s 00:00', date('Y', $requestTime), date('n', $requestTime), $day))); $timeTo = strtotime('+1 day', strtotime(sprintf('%s-%s-%s 00:00', date('Y', $requestTime), date('n', $requestTime), $day)));

2
src/public/peer.php

@ -20,7 +20,7 @@ try {
// Connect memcached // Connect memcached
try { try {
$memory = new Yggverse\Cache\Memory(MEMCACHED_HOST, MEMCACHED_PORT, MEMCACHED_NAMESPACE, MEMCACHED_TIMEOUT); $memory = new Yggverse\Cache\Memory(MEMCACHED_HOST, MEMCACHED_PORT, MEMCACHED_NAMESPACE, MEMCACHED_TIMEOUT + time());
} catch(Exception $e) { } catch(Exception $e) {

Loading…
Cancel
Save