mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
Fix mass purge
This commit is contained in:
parent
b0df79bb80
commit
e208d7f72a
@ -146,6 +146,7 @@ public class Purge extends SubCommand {
|
|||||||
Runnable run = new Runnable() {
|
Runnable run = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
PS.debug("Calculating plots to purge, please wait...");
|
||||||
HashSet<Integer> ids = new HashSet<>();
|
HashSet<Integer> ids = new HashSet<>();
|
||||||
for (Plot plot : toDelete) {
|
for (Plot plot : toDelete) {
|
||||||
if (plot.temp != Integer.MAX_VALUE) {
|
if (plot.temp != Integer.MAX_VALUE) {
|
||||||
|
@ -209,6 +209,7 @@ public class Trim extends SubCommand {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Trim.TASK = false;
|
Trim.TASK = false;
|
||||||
|
player.sendMessage("Trim done!");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -2040,9 +2040,8 @@ public class SQLManager implements AbstractDB {
|
|||||||
try {
|
try {
|
||||||
ArrayList<Integer> uniqueIdsList = new ArrayList<Integer>(uniqueIds);
|
ArrayList<Integer> uniqueIdsList = new ArrayList<Integer>(uniqueIds);
|
||||||
String stmt_prefix = "";
|
String stmt_prefix = "";
|
||||||
StringBuilder idstr2 = new StringBuilder("");
|
|
||||||
int size = uniqueIdsList.size();
|
int size = uniqueIdsList.size();
|
||||||
int packet = 5000;
|
int packet = 990;
|
||||||
int amount = size / packet;
|
int amount = size / packet;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int last = -1;
|
int last = -1;
|
||||||
@ -2052,6 +2051,8 @@ public class SQLManager implements AbstractDB {
|
|||||||
if (subList.isEmpty()) {
|
if (subList.isEmpty()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
StringBuilder idstr2 = new StringBuilder("");
|
||||||
|
stmt_prefix = "";
|
||||||
for (Integer id : subList) {
|
for (Integer id : subList) {
|
||||||
idstr2.append(stmt_prefix).append(id);
|
idstr2.append(stmt_prefix).append(id);
|
||||||
stmt_prefix = " OR `id` = ";
|
stmt_prefix = " OR `id` = ";
|
||||||
@ -2082,6 +2083,7 @@ public class SQLManager implements AbstractDB {
|
|||||||
.prepareStatement("DELETE FROM `" + SQLManager.this.prefix + "plot` WHERE `id` = " + idstr2);
|
.prepareStatement("DELETE FROM `" + SQLManager.this.prefix + "plot` WHERE `id` = " + idstr2);
|
||||||
stmt.executeUpdate();
|
stmt.executeUpdate();
|
||||||
stmt.close();
|
stmt.close();
|
||||||
|
commit();
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
Loading…
Reference in New Issue
Block a user