9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-19 15:09:18 +00:00

change the trimming cycle to make sure one step happens per second

This commit is contained in:
Julian Krings
2025-08-24 17:19:50 +02:00
parent 770e2f47a2
commit e8bfce469d

View File

@@ -157,6 +157,7 @@ public class IrisEngineSVC implements IrisService {
private final class Registered { private final class Registered {
private final String name; private final String name;
private final PlatformChunkGenerator access; private final PlatformChunkGenerator access;
private final int offset = RNG.r.nextInt(1000);
private transient ScheduledFuture<?> trimmer; private transient ScheduledFuture<?> trimmer;
private transient ScheduledFuture<?> unloader; private transient ScheduledFuture<?> unloader;
private transient boolean closed; private transient boolean closed;
@@ -193,7 +194,7 @@ public class IrisEngineSVC implements IrisService {
Iris.error("EngineSVC: Failed to trim for " + name); Iris.error("EngineSVC: Failed to trim for " + name);
e.printStackTrace(); e.printStackTrace();
} }
}, RNG.r.nextInt(1000), 1000, TimeUnit.MILLISECONDS); }, offset, 2000, TimeUnit.MILLISECONDS);
} }
if (unloader == null || unloader.isDone() || unloader.isCancelled()) { if (unloader == null || unloader.isDone() || unloader.isCancelled()) {
@@ -213,7 +214,7 @@ public class IrisEngineSVC implements IrisService {
Iris.error("EngineSVC: Failed to unload for " + name); Iris.error("EngineSVC: Failed to unload for " + name);
e.printStackTrace(); e.printStackTrace();
} }
}, RNG.r.nextInt(1000), 1000, TimeUnit.MILLISECONDS); }, offset + 1000, 2000, TimeUnit.MILLISECONDS);
} }
} }