X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/effd8e12af440586594a18a04beb33abed260d15..f05ea577f42c5ad4a62ff25ec62fbb60c550ee26:/utils/blocks.php diff --git a/utils/blocks.php b/utils/blocks.php index 7388d2f4..46b5ad05 100755 --- a/utils/blocks.php +++ b/utils/blocks.php @@ -17,14 +17,12 @@ $aCMDOptions = array( getCmdOpt($_SERVER['argv'], $aCMDOptions, $aResult, true, true); $m = getBucketMemcache(); - if (!$m) -{ +if (!$m) { echo "ERROR: Bucket memcache is not configured\n"; exit; } -if ($aResult['list']) -{ +if ($aResult['list']) { $iCurrentSleeping = $m->get('sleepCounter'); echo "\n Sleeping blocks count: $iCurrentSleeping\n"; @@ -32,8 +30,7 @@ if ($aResult['list']) echo "\n"; printf(" %-40s | %12s | %7s | %13s | %31s | %8s\n", "Key", "Total Blocks", "Current", "Still Blocked", "Last Block Time", "Sleeping"); printf(" %'--40s-|-%'-12s-|-%'-7s-|-%'-13s-|-%'-31s-|-%'-8s\n", "", "", "", "", "", ""); - foreach($aBlocks as $sKey => $aDetails) - { + foreach ($aBlocks as $sKey => $aDetails) { printf(" %-40s | %12s | %7s | %13s | %31s | %8s\n", $sKey, $aDetails['totalBlocks'], (int)$aDetails['currentBucketSize'], $aDetails['currentlyBlocked']?'Y':'N', date("r", $aDetails['lastBlockTimestamp']), $aDetails['isSleeping']?'Y':'N'); @@ -41,13 +38,11 @@ if ($aResult['list']) echo "\n"; } -if ($aResult['delete']) -{ +if ($aResult['delete']) { $m->set('sleepCounter', 0); clearBucketBlocks(); } -if ($aResult['flush']) -{ +if ($aResult['flush']) { $m->flush(); }