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
|
||||
public void onDisable() {
|
||||
|
||||
FileConfiguration config = getConfig();
|
||||
if (config.getBoolean("also-delete-logs-on-shutdown")) {
|
||||
new Thread(() -> {
|
||||
deleteLogs();
|
||||
}).start();
|
||||
|
||||
//we aren't using separate thread here, so it has time to finish before server shutdowns
|
||||
|
||||
deleteLogs();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user