[ADDED] Temporarily disable all crons on pool maintenance

This commit is contained in:
Sebastian Grewe 2016-07-07 10:50:30 +02:00
parent 62e01bd9b1
commit c35b232152
4 changed files with 10 additions and 1 deletions

View File

@ -69,6 +69,12 @@ $log->LogDebug('Starting ' . $cron_name);
// Load the start time for later runtime calculations for monitoring
$cron_start[$cron_name] = microtime(true);
// Skip all crons if admin enabled pool maintenance
if ($setting->getValue('maintenance')) {
$log->logInfo('Cronjobs disabled due to pool maintenance');
$monitoring->endCronjob($cron_name, 'E0083', 2, true, false);
}
// Check if our cron is activated
if ($monitoring->isDisabled($cron_name)) {
$log->logFatal('Cronjob is currently disabled due to errors, use -f option to force running cron.');

View File

@ -131,7 +131,7 @@ class Monitoring extends Base {
$this->setErrorMessage('Failed to send mail notification');
}
if ($fatal) {
if ($exitCode != 0) $this->setStatus($cron_name . "_disabled", "yesno", 1);
if ($exitCode == 1) $this->setStatus($cron_name . "_disabled", "yesno", 1);
exit($exitCode);
}
}

View File

@ -78,3 +78,4 @@ $aErrorCodes['E0079'] = 'Wallet does not cover payouts total amount';
$aErrorCodes['E0080'] = 'No new unaccounted shares since last run';
$aErrorCodes['E0081'] = 'Failed to insert new block into database';
$aErrorCodes['E0082'] = 'Block does not supply any usable confirmation information';
$aErrorCodes['E0083'] = 'Maintenance mode enabled, skipped';

View File

@ -25,6 +25,8 @@
{if $event.type == 'okerror'}
{if $event.value == 0}
<font color="green">OK</font>
{else if $event.value == 2}
<font color="orange">WARN</font>
{else}
<font color="red">ERROR</font>
{/if}