Skip to content

Commit 645aa37

Browse files
committed
Using file cache for tokens.
1 parent 36a98c0 commit 645aa37

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

service/lib/ethplorer.php

+10-1
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,16 @@ public function getTokens($updateCache = false){
10471047
if(FALSE !== $this->aTokens){
10481048
return $this->aTokens;
10491049
}
1050-
$aResult = $this->oCache->get('tokens', false, true);
1050+
1051+
$useFileCache = false;
1052+
$tokensFile = dirname(__FILE__) . '/../cache.tokens.php';
1053+
if($useFileCache && file_exists($tokensFile)){
1054+
$aResult = include_once $tokensFile;
1055+
$updateCache = false;
1056+
}else{
1057+
$aResult = $this->oCache->get('tokens', false, true);
1058+
}
1059+
10511060
// Allow generating cache only from cron jobs
10521061
if(!$this->getTokensCacheCreation && ($updateCache/* || (false === $aResult)*/)){
10531062
// Recursion protection

0 commit comments

Comments
 (0)