Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cronjobs/shared.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down
2 changes: 1 addition & 1 deletion include/classes/monitoring.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
1 change: 1 addition & 0 deletions include/config/error_codes.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
2 changes: 2 additions & 0 deletions templates/bootstrap/admin/monitoring/default.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down