Fixed clearlog deleting all log when using a keepLogDays higher than

24 days.
This commit is contained in:
Robin Kupper
2011-04-14 13:07:24 +02:00
parent 2230017cdb
commit 1228fcc2ac

View File

@@ -28,7 +28,8 @@ public class ClearLog implements Runnable
Statement state = null;
try {
state = conn.createStatement();
String time = new SimpleDateFormat("yy-MM-dd-HH-mm-ss").format(System.currentTimeMillis() - LogBlock.config.keepLogDays*86400000);
String time = new SimpleDateFormat("yy-MM-dd-HH-mm-ss").format(System.currentTimeMillis() - LogBlock.config.keepLogDays*86400000L);
LogBlock.log.info("Deleting log older than " + time);
ResultSet rs;
for (String table : LogBlock.config.tables.values()) {
rs = state.executeQuery("SELECT count(*) FROM `" + table + "` WHERE date < '" + time + "'");