mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-26 12:35:11 +01:00
Also remove the cached FK for the map-id when we delete it from the db >_>
This commit is contained in:
parent
1336d26b9f
commit
8af13df3f9
@ -377,6 +377,7 @@ public void deleteMeta(String mapId, String name) throws IOException {
|
||||
|
||||
@Override
|
||||
public void purgeMap(String mapId, Function<ProgressInfo, Boolean> onProgress) throws IOException {
|
||||
synchronized (mapFKs) {
|
||||
try {
|
||||
recoveringConnection(connection -> {
|
||||
executeUpdate(connection,
|
||||
@ -397,6 +398,7 @@ public void purgeMap(String mapId, Function<ProgressInfo, Boolean> onProgress) t
|
||||
mapId
|
||||
);
|
||||
|
||||
|
||||
executeUpdate(connection,
|
||||
"DELETE " +
|
||||
"FROM `bluemap_map` " +
|
||||
@ -404,10 +406,14 @@ public void purgeMap(String mapId, Function<ProgressInfo, Boolean> onProgress) t
|
||||
mapId
|
||||
);
|
||||
}, 2);
|
||||
|
||||
mapFKs.invalidate(mapId);
|
||||
|
||||
} catch (SQLException ex) {
|
||||
throw new IOException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> collectMapIds() throws IOException {
|
||||
@ -670,8 +676,10 @@ private int getMapTileCompressionFK(Compression compression) throws SQLException
|
||||
}
|
||||
|
||||
private int loadMapFK(String mapId) throws SQLException, IOException {
|
||||
synchronized (mapFKs) {
|
||||
return lookupFK("bluemap_map", "id", "map_id", mapId);
|
||||
}
|
||||
}
|
||||
|
||||
private int loadMapTileCompressionFK(Compression compression) throws SQLException, IOException {
|
||||
return lookupFK("bluemap_map_tile_compression", "id", "compression", compression.getTypeId());
|
||||
|
Loading…
Reference in New Issue
Block a user