cron scripts: replace fwrite'ing to lockfile by logging

This commit is contained in:
Daniel Reichelt
2016-02-16 15:04:20 +01:00
parent f65af0067d
commit f86a115c6a
10 changed files with 56 additions and 95 deletions

View File

@@ -18,7 +18,7 @@
*
*/
fwrite($debugHandler, "calculating mailspace usage\n");
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'calculating mailspace usage');
$maildirs_stmt = Database::query("
SELECT `id`, CONCAT(`homedir`, `maildir`) AS `maildirpath` FROM `".TABLE_MAIL_USERS."` ORDER BY `id`
@@ -50,6 +50,6 @@ while ($maildir = $maildirs_stmt->fetch(PDO::FETCH_ASSOC)) {
unset($back);
Database::pexecute($upd_stmt, array('size' => $emailusage, 'id' => $maildir['id']));
} else {
fwrite($debugHandler, 'maildir ' . $_maildir . ' does not exist' . "\n");
$cronlog->logAction(CRON_ACTION, LOG_WARNING, 'maildir ' . $_maildir . ' does not exist');
}
}