From da9e99596e2fcb76a37fcc8a24c8eacd00ff186c Mon Sep 17 00:00:00 2001
From: Florian Schaal <florian@schaal-24.de>
Date: Mon, 14 Sep 2015 04:23:58 -0400
Subject: [PATCH] resize openvz-server with ploop enabled

---
 server/lib/classes/monitor_tools.inc.php |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/server/lib/classes/monitor_tools.inc.php b/server/lib/classes/monitor_tools.inc.php
index 4e25d38..ce3d4bb 100644
--- a/server/lib/classes/monitor_tools.inc.php
+++ b/server/lib/classes/monitor_tools.inc.php
@@ -666,7 +666,7 @@
 
 		// $now = time();
 		// $old = $now - (4 * 60); // 4 minutes
-		$old = 'UNIX_TIMESTAMP() - 240';
+		$old = 240; //seconds
 
 		/*
 		 * ATTENTION if i do NOT pay attention of the server id, i delete all data (of the type)
@@ -676,13 +676,7 @@
 		 * even though it is the NEWEST data of this server. To avoid this i HAVE to include
 		 * the server-id!
 		 */
-		$sql = 'DELETE FROM monitor_data ' .
-			'WHERE ' .
-			'  type = ?' .
-			'AND ' .
-			'  created < ? ' .
-			'AND ' .
-			'  server_id = ?';
+		$sql = 'DELETE FROM `monitor_data` WHERE `type` = ? AND `created` < UNIX_TIMESTAMP() - ? AND `server_id` = ?';
 		$app->dbmaster->query($sql, $type, $old, $serverId);
 	}
 

--
Gitblit v1.9.1