mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-06-17 22:32:04 +00:00
More shutdown fixes
This commit is contained in:
@@ -37,7 +37,6 @@ public class EditSVC implements IrisService {
|
|||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
this.editors = new KMap<>();
|
this.editors = new KMap<>();
|
||||||
Iris.info("EDIT SVC ENABLED!");
|
|
||||||
Bukkit.getScheduler().scheduleSyncRepeatingTask(Iris.instance, this::update, 1000, 1000);
|
Bukkit.getScheduler().scheduleSyncRepeatingTask(Iris.instance, this::update, 1000, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,52 +74,53 @@ public class PreservationSVC implements IrisService
|
|||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
dereferencer.interrupt();
|
dereferencer.interrupt();
|
||||||
|
dereference();
|
||||||
|
|
||||||
for(Thread i : threads)
|
postShutdown(() -> {
|
||||||
{
|
for(Thread i : threads)
|
||||||
if(i.isAlive())
|
{
|
||||||
|
if(i.isAlive())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
i.interrupt();
|
||||||
|
Iris.info("Shutdown Thread " + i.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
catch(Throwable e)
|
||||||
|
{
|
||||||
|
Iris.reportError(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(MultiBurst i : bursts)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
i.interrupt();
|
i.shutdownNow();
|
||||||
Iris.info("Shutdown Thread " + i.getName());
|
Iris.info("Shutdown Multiburst " + i);
|
||||||
}
|
}
|
||||||
|
|
||||||
catch(Throwable e)
|
catch(Throwable e)
|
||||||
{
|
{
|
||||||
|
Iris.reportError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for(MultiBurst i : bursts)
|
for(ExecutorService i : services)
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
i.shutdownNow();
|
try
|
||||||
Iris.info("Shutdown Multiburst " + i);
|
{
|
||||||
|
i.shutdownNow();
|
||||||
|
Iris.info("Shutdown Executor Service " + i);
|
||||||
|
}
|
||||||
|
|
||||||
|
catch(Throwable e)
|
||||||
|
{
|
||||||
|
Iris.reportError(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
catch(Throwable e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(ExecutorService i : services)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
i.shutdownNow();
|
|
||||||
Iris.info("Shutdown Executor Service " + i);
|
|
||||||
}
|
|
||||||
|
|
||||||
catch(Throwable e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dereference();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import com.volmit.iris.engine.framework.WrongEngineBroException;
|
|||||||
import com.volmit.iris.engine.object.common.IrisWorld;
|
import com.volmit.iris.engine.object.common.IrisWorld;
|
||||||
import com.volmit.iris.engine.object.dimensional.IrisDimension;
|
import com.volmit.iris.engine.object.dimensional.IrisDimension;
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
|
import com.volmit.iris.util.format.C;
|
||||||
import com.volmit.iris.util.hunk.Hunk;
|
import com.volmit.iris.util.hunk.Hunk;
|
||||||
import com.volmit.iris.util.io.ReactiveFolder;
|
import com.volmit.iris.util.io.ReactiveFolder;
|
||||||
import com.volmit.iris.util.scheduling.ChronoLatch;
|
import com.volmit.iris.util.scheduling.ChronoLatch;
|
||||||
@@ -161,7 +162,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
|||||||
r.run();
|
r.run();
|
||||||
loadLock.release(LOAD_LOCKS);
|
loadLock.release(LOAD_LOCKS);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
Iris.reportError(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -207,7 +207,16 @@ public class Mantle {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
b.complete();
|
try
|
||||||
|
{
|
||||||
|
b.complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
catch(Throwable e)
|
||||||
|
{
|
||||||
|
Iris.reportError(e);
|
||||||
|
}
|
||||||
|
|
||||||
ioBurst.shutdownNow();
|
ioBurst.shutdownNow();
|
||||||
Iris.debug("The Mantle has Closed " + C.DARK_AQUA + dataFolder.getAbsolutePath());
|
Iris.debug("The Mantle has Closed " + C.DARK_AQUA + dataFolder.getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user