mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-28 22:04:57 +01:00
Is this thing on?
- Fix new fabric instances defaulting to flywheel:off
This commit is contained in:
parent
94d99af4b0
commit
4ca5e202a2
2 changed files with 6 additions and 3 deletions
|
@ -18,8 +18,6 @@ public final class FlwImpl {
|
||||||
// impl
|
// impl
|
||||||
BackendManagerImpl.init();
|
BackendManagerImpl.init();
|
||||||
|
|
||||||
// lib
|
|
||||||
|
|
||||||
// backend
|
// backend
|
||||||
FlwBackend.init(FlwConfig.INSTANCE.backendConfig());
|
FlwBackend.init(FlwConfig.INSTANCE.backendConfig());
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,8 @@ public class FabricFlwConfig implements FlwConfig {
|
||||||
|
|
||||||
private final File file;
|
private final File file;
|
||||||
|
|
||||||
public Backend backend = BackendManager.defaultBackend();
|
// Don't actually default to off, we'll find the true default in #load
|
||||||
|
public Backend backend = BackendManager.offBackend();
|
||||||
public boolean limitUpdates = LIMIT_UPDATES_DEFAULT;
|
public boolean limitUpdates = LIMIT_UPDATES_DEFAULT;
|
||||||
public int workerThreads = WORKER_THREADS_DEFAULT;
|
public int workerThreads = WORKER_THREADS_DEFAULT;
|
||||||
|
|
||||||
|
@ -69,6 +70,10 @@ public class FabricFlwConfig implements FlwConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void load() {
|
public void load() {
|
||||||
|
// Grab the default backend here because this object is constructed
|
||||||
|
// very early in flywheel loading and not all backends may be registered
|
||||||
|
backend = BackendManager.defaultBackend();
|
||||||
|
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
try (FileReader reader = new FileReader(file)) {
|
try (FileReader reader = new FileReader(file)) {
|
||||||
fromJson(JsonParser.parseReader(reader));
|
fromJson(JsonParser.parseReader(reader));
|
||||||
|
|
Loading…
Reference in a new issue