Use main thread for shutdown deletion so it completes in time

This commit is contained in:
Govindas 2021-06-12 15:10:37 +03:00
parent 780f95c09f
commit c10677ee98
1 changed files with 4 additions and 4 deletions

View File

@ -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();
}
}