Skip to content

Commit c865f18

Browse files
author
Till Brehm
committed
Merge branch 'misc-updates' into 'develop'
Misc updates See merge request ispconfig/ispconfig3!1935
2 parents d228f63 + 0e6d59d commit c865f18

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

server/lib/classes/cron.d/100-mailbox_stats_hourly.inc.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ class cronjob_mailbox_stats_hourly extends cronjob {
3636
protected $mail_boxes = array();
3737
protected $mail_rewrites = array();
3838

39+
private $_tools = null;
40+
3941
/* this function is optional if it contains no custom code */
4042
public function onPrepare() {
4143
global $app;
@@ -61,7 +63,7 @@ public function onRunJob() {
6163

6264
$sql = "SELECT mailuser_id FROM mail_user WHERE server_id = ?";
6365
$records = $app->db->queryAllRecords($sql, $conf['server_id']);
64-
if(count($records) > 0) {
66+
if(count($records) > 0) {
6567
$this->update_last_mail_login();
6668
}
6769

server/lib/classes/cron.d/100-monitor_hd_quota.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function onRunJob() {
7373
//* No Quota on this System ...
7474

7575
//** Fetch the data for all users
76-
$dfData = shell_exec('du -s /var/www/clients/client*/we*');
76+
$dfData = shell_exec('du -s /var/www/clients/client*/web[0-9]*');
7777

7878
//* split into array
7979
$df = explode("\n", $dfData);

server/lib/classes/cron.d/300-quota_notify.inc.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class cronjob_quota_notify extends cronjob {
3333
// job schedule
3434
protected $_schedule = '0 0 * * *';
3535

36+
private $_tools = null;
37+
3638
/* this function is optional if it contains no custom code */
3739
public function onPrepare() {
3840
global $app;

server/lib/classes/cronjob.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ protected function onPrepare() {
103103
// check the run time and values for this job
104104

105105
// remove stale cronjobs
106-
$data = $app->db->queryAllRecords("SELECT `last_run` FROM `sys_cron` WHERE `name` = ? AND (`last_run` IS NOT NULL AND `last_run` < DATE_SUB(NOW(), INTERVAL 24 HOUR)) AND `running` = 1", get_class($this));
106+
$data = $app->db->queryAllRecords("SELECT `name`, `last_run` FROM `sys_cron` WHERE `name` = ? AND (`last_run` IS NOT NULL AND `last_run` < DATE_SUB(NOW(), INTERVAL 24 HOUR)) AND `running` = 1", get_class($this));
107107
foreach ($data as $rec) {
108108
if($conf['log_priority'] <= LOGLEVEL_WARN) print "Removing stale sys_cron entry for ".get_class($this)." (last run ".$rec['last_run'].")\n";
109109
$app->db->query("DELETE FROM `sys_cron` WHERE `name` = ? AND `last_run` = ? AND `running` = 1", $rec['name'], $rec['last_run']);
@@ -149,10 +149,10 @@ protected function onBeforeRun() {
149149

150150
// next_run time reached (reached === 0 or -1)
151151

152-
// calculare next run time based on last_run or current time
152+
// calculate next run time based on last_run or current time
153153
$app->cron->parseCronLine($this->getSchedule());
154154
if($this->_no_skip == true) {
155-
// we need to calculare the next run based on the previous next_run, as we may not skip one.
155+
// we need to calculate the next run based on the previous next_run, as we may not skip one.
156156
$next_run = $app->cron->getNextRun($this->_next_run);
157157
if($next_run === false) {
158158
// we could not calculate next run, try it with current time

0 commit comments

Comments
 (0)