Fixed TPS Table cleaning

This commit is contained in:
Rsl1122 2018-07-16 10:30:02 +03:00
parent 9872c9d209
commit 1fbd1fb943

View File

@ -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);
} }
}); });
} }