mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-25 01:57:53 +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();
|
c = getConnection();
|
||||||
// Query tiles for given mapkey
|
// Query tiles for given mapkey
|
||||||
Statement stmt = c.createStatement();
|
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();
|
stmt.close();
|
||||||
} catch (SQLException x) {
|
} catch (SQLException x) {
|
||||||
Log.severe("Tile purge error - " + x.getMessage());
|
Log.severe("Tile purge error - " + x.getMessage());
|
||||||
|
Loading…
Reference in New Issue
Block a user