mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-03 06:57:33 +01:00
Synchronize YamlRegionFile#saveAll
This prevents multiple invocations of the method from intersecting, which could potentially cause the .tmp file to be overwritten before being renamed, thus corrupting the region storage
This commit is contained in:
parent
8cbce96a2c
commit
7ba0fd3f53
@ -192,7 +192,7 @@ public Set<ProtectedRegion> loadAll(FlagRegistry flagRegistry) throws StorageExc
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveAll(Set<ProtectedRegion> regions) throws StorageException {
|
||||
public synchronized void saveAll(Set<ProtectedRegion> regions) throws StorageException {
|
||||
checkNotNull(regions);
|
||||
|
||||
File tempFile = new File(file.getParentFile(), file.getName() + ".tmp");
|
||||
|
Loading…
Reference in New Issue
Block a user