Enable sites, if config does not exist
Sites were only enabled, if the config existed. That's why all sites were disabled on the very first start.
This commit is contained in:
parent
5cab782510
commit
2e3e7d2419
|
@ -59,14 +59,14 @@ public class Config {
|
|||
BufferedSource source = buffer.readFrom(fin);
|
||||
settings = adapter.fromJson(source);
|
||||
settings.httpTimeout = Math.max(settings.httpTimeout, 10_000);
|
||||
for (Site site : sites) {
|
||||
site.setEnabled(!settings.disabledSites.contains(site.getName()));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
LOG.error("Config file does not exist. Falling back to default values.");
|
||||
settings = OS.getDefaultSettings();
|
||||
}
|
||||
for (Site site : sites) {
|
||||
site.setEnabled(!settings.disabledSites.contains(site.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized void init(List<Site> sites) throws FileNotFoundException, IOException {
|
||||
|
|
Loading…
Reference in New Issue