Permalink
Browse files

[ADDED] Temporarily disable all crons on pool maintenance

  • Loading branch information...
Sebastian Grewe
Sebastian Grewe committed Jul 7, 2016
1 parent 62e01bd commit c35b2321528a7fcb5ffd93921fdd10c162a56f54
View
@@ -69,6 +69,12 @@ function cfip() { return (@defined('SECURITY')) ? 1 : 0; }
// 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.');
@@ -131,7 +131,7 @@ public function endCronjob($cron_name, $msgCode, $exitCode=0, $fatal=false, $mai
$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);
}
}
@@ -78,3 +78,4 @@
$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';
@@ -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}

0 comments on commit c35b232

Please sign in to comment.