10000 cache_tokens updated (debug and memory limit) · etherscan-io/Ethplorer@7d4da6c · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d4da6c

Browse files
committed
cache_tokens updated (debug and memory limit)
1 parent 5356323 commit 7d4da6c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

bin/cache_tokens.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
ini_set('memory_limit', '512M');
18+
ini_set('memory_limit', '1G');
1919

2020
// define('ETHPLORER_SHOW_OUTPUT', 1);
2121

service/lib/ethplorer.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,9 +1000,7 @@ public function getTokens($updateCache = false){
10001000
unset($aToken["_id"]);
10011001
$aResult[$address] = $aToken;
10021002
if(!isset($aPrevTokens[$address]) || ($aPrevTokens[$address]['transfersCount'] < $aToken['transfersCount'])){
1003-
if(defined('ETHPLORER_SHOW_OUTPUT')){
1004-
echo $address . " was recently updated (transfers count = " . $aToken['transfersCount'] . ")\n";
1005-
}
1003+
$this->_cliDebug($address . " was recently updated (transfers count = " . $aToken['transfersCount'] . ")");
10061004
$aResult[$address]['issuancesCount'] = $this->getContractOperationCount(array('$in' => array('issuance', 'burn', 'mint')), $address, FALSE);
10071005
$hc = $this->getTokenHoldersCount($address);;
10081006
if(FALSE !== $hc){
@@ -3325,7 +3323,8 @@ protected function getEthToken(){
33253323
}
33263324

33273325
protected function _cliDebug($message){
3328-
if(isset($this->aSettings['cliDebug']) && $this->aSettings['cliDebug'] && (php_sapi_name() === 'cli')){
3326+
$showDebug = ((isset($this->aSettings['cliDebug']) && $this->aSettings['cliDebug']) || defined('ETHPLORER_SHOW_OUTPUT')) && (php_sapi_name() === 'cli');
3327+
if($showDebug){
33293328
echo '[' . date("Y-m-d H:i:s") . '] ' . $message . "\n";
33303329
}
33313330
}

0 commit comments

Comments
 (0)
0