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:
0xboobface 2018-11-15 14:11:19 +01:00
parent 5cab782510
commit 2e3e7d2419
1 changed files with 3 additions and 3 deletions

View File

@ -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 {