mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-01-06 15:17:37 +01:00
c64627205e
- Speeded it up - Added Buy/Sell specified ID permission - Removed EXCLUDE_ITEM permission - just use normal Permission negating - Doesn't add more LWC's on an already protected block - Updated Register - Added option to turn off messages
26 lines
716 B
Java
26 lines
716 B
Java
package com.Acrobot.ChestShop.DB;
|
|
|
|
import com.Acrobot.ChestShop.ChestShop;
|
|
import com.Acrobot.ChestShop.Config.Config;
|
|
import com.Acrobot.ChestShop.Config.Property;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
/**
|
|
* @author Acrobot
|
|
*/
|
|
public class Queue implements Runnable {
|
|
private static final ArrayList<Transaction> queue = new ArrayList<Transaction>();
|
|
|
|
public static void addToQueue(Transaction t) {
|
|
queue.add(t);
|
|
}
|
|
|
|
public void run() {
|
|
ChestShop.getDB().delete(ChestShop.getDB().find(Transaction.class).where().lt("sec", System.currentTimeMillis() / 1000 - Config.getInteger(Property.RECORD_TIME_TO_LIVE)).findList());
|
|
|
|
ChestShop.getDB().save(queue);
|
|
queue.clear();
|
|
}
|
|
}
|