Use main thread for shutdown deletion so it completes in time
This commit is contained in:
parent
780f95c09f
commit
c10677ee98
@ -19,12 +19,12 @@ public class AutomaticLogDeleter extends JavaPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
|
|
||||||
FileConfiguration config = getConfig();
|
FileConfiguration config = getConfig();
|
||||||
if (config.getBoolean("also-delete-logs-on-shutdown")) {
|
if (config.getBoolean("also-delete-logs-on-shutdown")) {
|
||||||
new Thread(() -> {
|
|
||||||
deleteLogs();
|
//we aren't using separate thread here, so it has time to finish before server shutdowns
|
||||||
}).start();
|
|
||||||
|
deleteLogs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user