mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-12 19:30:44 +01: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 +
|
String sql = "DELETE FROM " + tableName +
|
||||||
" WHERE (" + Col.DATE + "<?)" +
|
" WHERE (" + Col.DATE + "<?)" +
|
||||||
" AND (" + Col.PLAYERS_ONLINE + "" +
|
" AND (" + Col.PLAYERS_ONLINE + " != ?)";
|
||||||
" != ?)";
|
|
||||||
|
|
||||||
execute(new ExecStatement(sql) {
|
execute(new ExecStatement(sql) {
|
||||||
@Override
|
@Override
|
||||||
public void prepare(PreparedStatement statement) throws SQLException {
|
public void prepare(PreparedStatement statement) throws SQLException {
|
||||||
statement.setInt(1, pValue);
|
// More than 3 Months ago.
|
||||||
// More than 2 Months ago.
|
long threeMonths = TimeAmount.MONTH.ms() * 3L;
|
||||||
long fiveWeeks = TimeAmount.MONTH.ms() * 2L;
|
statement.setLong(1, System.currentTimeMillis() - threeMonths);
|
||||||
statement.setLong(2, System.currentTimeMillis() - fiveWeeks);
|
statement.setInt(2, pValue);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user