Skip to content

Commit 2cc4439

Browse files
author
Till Brehm
committed
Merge branch '6453-update-directly' into 'develop'
Use a regular update to avoid waking the slaveserver Closes #6453 See merge request ispconfig/ispconfig3!1734
2 parents 7f4ceb0 + b2cf2a7 commit 2cc4439

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public function onRunJob() {
232232
// send notifications only if the website is over the quota threshold
233233
if($used_ratio <= $web_config['overquota_notify_threshold'] / 100) {
234234
// reset notification date
235-
if($rec['last_quota_notification']) $app->dbmaster->datalogUpdate('web_domain', array("last_quota_notification" => null), 'domain_id', $rec['domain_id']);
235+
if($rec['last_quota_notification']) $app->db->query("UPDATE web_domain SET last_quota_notification=null WHERE domain_id=?", $rec['domain_id']);
236236

237237
// send notification - everything ok again
238238
if($rec['last_quota_notification'] && $web_config['overquota_notify_onok'] == 'y' && ($web_config['overquota_notify_admin'] == 'y' || $web_config['overquota_notify_reseller'] == 'y' || $web_config['overquota_notify_client'] == 'y')) {
@@ -274,7 +274,7 @@ public function onRunJob() {
274274

275275
//* Send quota notifications
276276
if(($web_config['overquota_notify_admin'] == 'y' || $web_config['overquota_notify_reseller'] == 'y' || $web_config['overquota_notify_client'] == 'y') && $send_notification == true) {
277-
$app->dbmaster->datalogUpdate('web_domain', array("last_quota_notification" => date('Y-m-d')), 'domain_id', $rec['domain_id']);
277+
$app->db->query("UPDATE web_domain SET last_quota_notification=? WHERE domain_id=?", date('Y-m-d'), $rec['domain_id']);
278278

279279
$placeholders = array('{domain}' => $rec['domain'],
280280
'{admin_mail}' => ($global_config['admin_mail'] != ''? $global_config['admin_mail'] : 'root'),
@@ -371,7 +371,7 @@ public function onRunJob() {
371371
// send notifications only if the mail account is over the quota threshold
372372
if($used_ratio <= $mail_config['overquota_notify_threshold'] / 100) {
373373
// reset notification date
374-
if($rec['last_quota_notification']) $app->dbmaster->datalogUpdate('mail_user', array("last_quota_notification" => null), 'mailuser_id', $rec['mailuser_id']);
374+
if($rec['last_quota_notification']) $app->db->query("UPDATE mail_user SET last_quota_notification=null WHERE mailuser_id=?", $rec['mailuser_id']);
375375

376376
// send notification - everything ok again
377377
if($rec['last_quota_notification'] && $mail_config['overquota_notify_onok'] == 'y' && ($mail_config['overquota_notify_admin'] == 'y' || $web_config['overquota_notify_reseller'] == 'y' || $mail_config['overquota_notify_client'] == 'y')) {
@@ -413,7 +413,7 @@ public function onRunJob() {
413413
elseif($mail_config['overquota_notify_freq'] > 0 && $rec['notified_before'] >= $mail_config['overquota_notify_freq']) $send_notification = true;
414414

415415
if(($mail_config['overquota_notify_admin'] == 'y' || $mail_config['overquota_notify_reseller'] == 'y' || $mail_config['overquota_notify_client'] == 'y') && $send_notification == true) {
416-
$app->dbmaster->datalogUpdate('mail_user', array("last_quota_notification" => date('Y-m-d')), 'mailuser_id', $rec['mailuser_id']);
416+
$app->db->query("UPDATE mail_user SET last_quota_notification=? WHERE mailuser_id=?", date('Y-m-d'), $rec['mailuser_id']);
417417

418418
$placeholders = array('{email}' => $rec['email'],
419419
'{admin_mail}' => ($global_config['admin_mail'] != ''? $global_config['admin_mail'] : 'root'),
@@ -502,7 +502,7 @@ public function onRunJob() {
502502

503503
//* Send quota notifications
504504
if(($web_config['overquota_db_notify_admin'] == 'y' || $web_config['overquota_db_notify_reseller'] == 'y' || $web_config['overquota_db_notify_client'] == 'y') && $send_notification == true) {
505-
$app->dbmaster->datalogUpdate('web_database', array("last_quota_notification" => date('Y-m-d')), 'database_id', $rec['database_id']);
505+
$app->db->query("UPDATE web_database SET last_quota_notification=? WHERE database_id=?", date('Y-m-d'), $rec['database_id']);
506506
$placeholders = array(
507507
'{database_name}' => $rec['database_name'],
508508
'{admin_mail}' => ($global_config['admin_mail'] != ''? $global_config['admin_mail'] : 'root'),
@@ -536,7 +536,7 @@ public function onRunJob() {
536536

537537
} else {
538538
//* reset notification date
539-
if($rec['last_quota_notification']) $app->dbmaster->datalogUpdate('web_database', array("last_quota_notification" => null), 'database_id', $rec['database_id']);
539+
if($rec['last_quota_notification']) $app->db->query("UPDATE web_database SET last_quota_notification=null WHERE database_id=?", $rec['database_id']);
540540

541541
// send notification - everything ok again
542542
if($rec['last_quota_notification'] && $web_config['overquota_notify_onok'] == 'y' && ($web_config['overquota_db_notify_admin'] == 'y' || $web_config['overquota_db_notify_reseller'] == 'y' || $web_config['overquota_db_notify_client'] == 'y')) {

0 commit comments

Comments
 (0)