mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-15 05:41:51 +08:00
Fixed TPS Table cleaning
This commit is contained in:
parent
9872c9d209
commit
1fbd1fb943
@ -121,16 +121,15 @@ public class TPSTable extends Table {
|
||||
|
||||
String sql = "DELETE FROM " + tableName +
|
||||
" WHERE (" + Col.DATE + "<?)" +
|
||||
" AND (" + Col.PLAYERS_ONLINE + "" +
|
||||
" != ?)";
|
||||
" AND (" + Col.PLAYERS_ONLINE + " != ?)";
|
||||
|
||||
execute(new ExecStatement(sql) {
|
||||
@Override
|
||||
public void prepare(PreparedStatement statement) throws SQLException {
|
||||
statement.setInt(1, pValue);
|
||||
// More than 2 Months ago.
|
||||
long fiveWeeks = TimeAmount.MONTH.ms() * 2L;
|
||||
statement.setLong(2, System.currentTimeMillis() - fiveWeeks);
|
||||
// More than 3 Months ago.
|
||||
long threeMonths = TimeAmount.MONTH.ms() * 3L;
|
||||
statement.setLong(1, System.currentTimeMillis() - threeMonths);
|
||||
statement.setInt(2, pValue);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user