fix caching time

This commit is contained in:
Joshua Seigler 2016-07-01 18:18:55 -04:00
parent 1bc4c247d1
commit 46764e6879
2 changed files with 4 additions and 4 deletions

View file

@ -82,7 +82,7 @@ function renderChart(
if(is_null($poloniexJson)) {
$poloniexJson = getJson($poloniexUrl);
// Write to cache for next time
CacheManager::set('poloniex-json-'.$pair.'-'.$dataDuration, $poloniexJson, $dataDuration);
CacheManager::set('poloniex-json-'.$pair.'-'.$dataDuration, $poloniexJson, $dataResolution);
}
$chartData = [];
@ -111,10 +111,10 @@ function renderChart(
$im->destroy();
}
CacheManager::set($chartCacheKey, $result);
$resultExpires = time() + $dataDuration;
$resultExpires = time() + $dataResolution;
} else {
$resultExpires = CacheManager::getInfo($chartCacheKey)[ 'expired_time' ];
$startTime = $resultExpires - $dataDuration;
$startTime = $resultExpires - $dataResolution;
}
header('Expires: '.gmdate('D, d M Y H:i:s', $resultExpires));