Author: jflesch
Date: 2007-09-05 14:54:37 +0000 (Wed, 05 Sep 2007)
New Revision: 14972
Modified:
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoardFactory.java
Log:
Fix the plugin minifrost : deleting date and archiving date were not correcly
computed
Modified:
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoardFactory.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoardFactory.java
2007-09-05 13:57:44 UTC (rev 14971)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoardFactory.java
2007-09-05 14:54:37 UTC (rev 14972)
@@ -91,8 +91,14 @@
synchronized(db.dbLock) {
PreparedStatement st;
- java.sql.Timestamp timestamp = new
java.sql.Timestamp(new Date().getTime() - (deleteAfter * 24 * 60*60*1000));
+ java.sql.Timestamp timestamp = new
java.sql.Timestamp(new Date().getTime()
+
- ( ((long)deleteAfter) * 24 * 60*60*1000));
+ Logger.info(this, "Cleaning:");
+ Logger.info(this, "Now: "+new
Date().toString());
+ Logger.info(this, "Delete older than:
"+timestamp.toString()
+ + "
("+Integer.toString(deleteAfter)+")");
+
st =
db.getConnection().prepareStatement("SELECT "+
" id,
msgId, inReplyToId, subject, "+
"
nick, sigId, date, rev, read, "+
@@ -122,7 +128,10 @@
}
- timestamp = new java.sql.Timestamp(new
Date().getTime() - (archiveAfter * 24 * 60*60*1000));
+ timestamp = new java.sql.Timestamp(new
Date().getTime()
+ - (
((long)archiveAfter) * 24 * 60*60*1000));
+ Logger.info(this, "Archive older than:
"+timestamp.toString()+
+ "
("+Integer.toString(archiveAfter)+")");
st =
db.getConnection().prepareStatement("UPDATE frostKSKMessages SET archived =
TRUE WHERE date < ?");
st.setTimestamp(1, timestamp);