mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-24 17:47:40 +01:00
Limit MySQL purgemap deletes
This commit is contained in:
parent
45299a153c
commit
c887df5ad8
@ -751,7 +751,9 @@ public class MySQLMapStorage extends MapStorage {
|
||||
c = getConnection();
|
||||
// Query tiles for given mapkey
|
||||
Statement stmt = c.createStatement();
|
||||
stmt.executeUpdate("DELETE FROM " + tableTiles + " WHERE MapID=" + mapkey + ";");
|
||||
// Limit delete to 1000 at a time (avoid locking whole table)
|
||||
while (stmt.executeUpdate("DELETE FROM " + tableTiles + " WHERE MapID=" + mapkey + " LIMIT 1000;") > 0) {
|
||||
}
|
||||
stmt.close();
|
||||
} catch (SQLException x) {
|
||||
Log.severe("Tile purge error - " + x.getMessage());
|
||||
|
Loading…
Reference in New Issue
Block a user