projects
/
org.ibex.mail.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
64b5672
)
make REAP_EXPIRATION a parameter
author
adam
<adam@megacz.com>
Sat, 1 Mar 2008 05:56:47 +0000
(
05:56
+0000)
committer
adam
<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
patch
|
blob
|
history
diff --git
a/src/org/ibex/mail/SqliteDB.java
b/src/org/ibex/mail/SqliteDB.java
index
f6655a4
..
4b818ce
100644
(file)
--- a/
src/org/ibex/mail/SqliteDB.java
+++ b/
src/org/ibex/mail/SqliteDB.java
@@
-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 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; }
public Connection getConnection() { return conn; }
@@
-102,7
+104,7
@@
public class SqliteDB {
try {
Log.warn(Reaper.class, filename + " reaping...");
long when = System.currentTimeMillis();
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+"<?");
synchronized(SqliteDB.this) {
PreparedStatement ps =
conn.prepareStatement("select count(*) from "+reapTable+" where "+reapColumn+"<?");