make REAP_EXPIRATION a parameter
authoradam <adam@megacz.com>
Sat, 1 Mar 2008 05:56:47 +0000 (05:56 +0000)
committeradam <adam@megacz.com>
Sat, 1 Mar 2008 05:56:47 +0000 (05:56 +0000)
darcs-hash:20080301055647-5007d-faa576a871e1ef34fc2f9e4a90b44f984d073104.gz

src/org/ibex/mail/SqliteDB.java

index f6655a4..4b818ce 100644 (file)
@@ -19,6 +19,8 @@ public class SqliteDB {
     private HashMap<String,SqliteTable> tables = new HashMap<String,SqliteTable>();
 
     public static final int REAPER_INTERVAL_SECONDS = 60 * 60;
+    private static final int DAYS = 24 * 60 * 60 * 1000;
+    public static final int REAP_EXPIRATION = 5 * DAYS;
 
     public Connection getConnection() { return conn; }
 
@@ -102,7 +104,7 @@ public class SqliteDB {
             try {
                 Log.warn(Reaper.class, filename + " reaping...");
                 long when = System.currentTimeMillis();
-                when -= 5 * 24 * 60 * 60 * 1000;
+                when -= REAP_EXPIRATION;
                 synchronized(SqliteDB.this) {
                     PreparedStatement ps =
                         conn.prepareStatement("select count(*) from "+reapTable+" where "+reapColumn+"<?");