[CLEANUP] Coding style

This commit is contained in:
Sebastian Grewe 2014-01-26 09:30:59 +01:00
parent b02db092a2
commit 8ca9744ce1
3 changed files with 161 additions and 170 deletions

View File

@ -78,8 +78,7 @@ if ($setting->getValue('disable_manual_payouts') != 1) {
$log->logFatal('User has a remaining balance of ' . $aBalance['confirmed'] . ' after a successful payout!'); $log->logFatal('User has a remaining balance of ' . $aBalance['confirmed'] . ' after a successful payout!');
$monitoring->endCronjob($cron_name, 'E0065', 1, true); $monitoring->endCronjob($cron_name, 'E0065', 1, true);
} }
} } else {
else {
$log->logFatal('Failed to add new Debit_MP transaction in database for user ' . $user->getUserName($aData['account_id']) . ' ERROR: ' . $transaction->getCronError()); $log->logFatal('Failed to add new Debit_MP transaction in database for user ' . $user->getUserName($aData['account_id']) . ' ERROR: ' . $transaction->getCronError());
$monitoring->endCronjob($cron_name, 'E0064', 1, true); $monitoring->endCronjob($cron_name, 'E0064', 1, true);
} }
@ -87,17 +86,14 @@ if ($setting->getValue('disable_manual_payouts') != 1) {
} }
} }
} } else if (empty($aPayouts)) {
else if (empty($aPayouts)) {
$log->logInfo("\tStopping Payments. No Payout Requests Found."); $log->logInfo("\tStopping Payments. No Payout Requests Found.");
} } else {
else {
$log->logFatal("\tFailed Processing Manual Payment Queue...Aborting..."); $log->logFatal("\tFailed Processing Manual Payment Queue...Aborting...");
$monitoring->endCronjob($cron_name, 'E0050', 1, true); $monitoring->endCronjob($cron_name, 'E0050', 1, true);
} }
if (count($aPayouts > 0)) $log->logDebug(" found " . count($aPayouts) . " queued manual payout requests"); if (count($aPayouts > 0)) $log->logDebug(" found " . count($aPayouts) . " queued manual payout requests");
} } else {
else {
$log->logDebug("Manual payouts are disabled via admin panel"); $log->logDebug("Manual payouts are disabled via admin panel");
} }
if ($setting->getValue('disable_auto_payouts') != 1) { if ($setting->getValue('disable_auto_payouts') != 1) {
@ -116,8 +112,7 @@ if ($setting->getValue('disable_auto_payouts') != 1) {
// Send balance, fees are reduced later by RPC Server // Send balance, fees are reduced later by RPC Server
try { try {
$txid = $bitcoin->sendtoaddress($aUserData['coin_address'], $dBalance - $config['txfee_auto']); $txid = $bitcoin->sendtoaddress($aUserData['coin_address'], $dBalance - $config['txfee_auto']);
} } catch (Exception $e) {
catch (Exception $e) {
$log->logError('Skipping payment. Failed to send balance to coin address: ' . $aData['coin_address'] . ' ERROR: ' . $e->getMessage()); $log->logError('Skipping payment. Failed to send balance to coin address: ' . $aData['coin_address'] . ' ERROR: ' . $e->getMessage());
continue; continue;
} }
@ -138,27 +133,24 @@ if ($setting->getValue('disable_auto_payouts') != 1) {
$log->logFatal('User has a remaining balance of ' . $aBalance['confirmed'] . ' after a successful payout!'); $log->logFatal('User has a remaining balance of ' . $aBalance['confirmed'] . ' after a successful payout!');
$monitoring->endCronjob($cron_name, 'E0065', 1, true); $monitoring->endCronjob($cron_name, 'E0065', 1, true);
} }
} } else {
else {
$log->logFatal('Failed to add new Debit_AP transaction in database for user ' . $user->getUserName($aUserData['id']) . ' ERROR: ' . $transaction->getCronError()); $log->logFatal('Failed to add new Debit_AP transaction in database for user ' . $user->getUserName($aUserData['id']) . ' ERROR: ' . $transaction->getCronError());
$monitoring->endCronjob($cron_name, 'E0064', 1, true); $monitoring->endCronjob($cron_name, 'E0064', 1, true);
} }
} }
} }
} }
} } else if(empty($users)) {
else if(empty($users)) {
$log->logInfo("\tSkipping payments. No Auto Payments Eligible."); $log->logInfo("\tSkipping payments. No Auto Payments Eligible.");
$log->logDebug("Users have not configured their AP > 0"); $log->logDebug("Users have not configured their AP > 0");
} } else{
else{
$log->logFatal("\tFailed Processing Auto Payment Payment Queue. ERROR: " . $transaction->getCronError()); $log->logFatal("\tFailed Processing Auto Payment Payment Queue. ERROR: " . $transaction->getCronError());
$monitoring->endCronjob($cron_name, 'E0050', 1, true); $monitoring->endCronjob($cron_name, 'E0050', 1, true);
} }
} } else {
else {
$log->logDebug("Auto payouts disabled via admin panel"); $log->logDebug("Auto payouts disabled via admin panel");
} }
$log->logInfo("Completed Payouts"); $log->logInfo("Completed Payouts");
// Cron cleanup and monitoring // Cron cleanup and monitoring
require_once('cron_end.inc.php'); require_once('cron_end.inc.php');

View File

@ -196,8 +196,7 @@ if ($aAllBlocks = $block->getAllUnaccounted('ASC')) {
} }
$log->logInfo("\tBlock: " . $aBlock['id'] . "\t Block paid and accounted for."); $log->logInfo("\tBlock: " . $aBlock['id'] . "\t Block paid and accounted for.");
} }
} } else if (empty($aAllBlocks)) {
else if (empty($aAllBlocks)) {
$log->logInfo("\tNo new blocks."); $log->logInfo("\tNo new blocks.");
// No monitoring event here, not fatal for PPS // No monitoring event here, not fatal for PPS
} else { } else {