Fix race condition starting multiple database downloads (Related #1581)
This commit is contained in:
parent
5058747b10
commit
f39141ed53
@ -120,6 +120,9 @@ public class GeoIpService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//set the downloading flag in order to fix race conditions outside
|
||||||
|
downloading = true;
|
||||||
|
|
||||||
// File is outdated or doesn't exist - let's try to download the data file!
|
// File is outdated or doesn't exist - let's try to download the data file!
|
||||||
// use bukkit's cached threads
|
// use bukkit's cached threads
|
||||||
bukkitService.runTaskAsynchronously(this::updateDatabase);
|
bukkitService.runTaskAsynchronously(this::updateDatabase);
|
||||||
@ -130,8 +133,6 @@ public class GeoIpService {
|
|||||||
* Tries to update the database by downloading a new version from the website.
|
* Tries to update the database by downloading a new version from the website.
|
||||||
*/
|
*/
|
||||||
private void updateDatabase() {
|
private void updateDatabase() {
|
||||||
downloading = true;
|
|
||||||
|
|
||||||
ConsoleLogger.info("Downloading GEO IP database, because the old database is older than "
|
ConsoleLogger.info("Downloading GEO IP database, because the old database is older than "
|
||||||
+ UPDATE_INTERVAL_DAYS + " days or doesn't exist");
|
+ UPDATE_INTERVAL_DAYS + " days or doesn't exist");
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user