Commit 960045a3 authored by Tom Evans's avatar Tom Evans

OF-764: Restore default of two days for MUC history reload

parent 8667c641
...@@ -227,15 +227,10 @@ public class MUCPersistenceManager { ...@@ -227,15 +227,10 @@ public class MUCPersistenceManager {
// enabled // enabled
if (room.isLogEnabled()) { if (room.isLogEnabled()) {
pstmt = con.prepareStatement(LOAD_HISTORY); pstmt = con.prepareStatement(LOAD_HISTORY);
// Reload the history, using "muc.history.reload.limit" (days) if present // Reload the history, using "muc.history.reload.limit" (days); defaults to 2
long from = 0; int reloadLimitDays = JiveGlobals.getIntProperty(MUC_HISTORY_RELOAD_LIMIT, 2);
String reloadLimit = JiveGlobals.getProperty(MUC_HISTORY_RELOAD_LIMIT); Log.warn("MUC history reload limit set to " + reloadLimitDays + " days");
if (reloadLimit != null) { long from = System.currentTimeMillis() - (86400000 * reloadLimitDays);
// if the property is defined, but not numeric, default to 2 (days)
int reloadLimitDays = JiveGlobals.getIntProperty(MUC_HISTORY_RELOAD_LIMIT, 2);
Log.warn("MUC history reload limit set to " + reloadLimitDays + " days");
from = System.currentTimeMillis() - (86400000 * reloadLimitDays);
}
pstmt.setString(1, StringUtils.dateToMillis(new Date(from))); pstmt.setString(1, StringUtils.dateToMillis(new Date(from)));
pstmt.setLong(2, room.getID()); pstmt.setLong(2, room.getID());
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment