use of org.bimserver.database.OldQuery in project BIMserver by opensourceBIM.
the class ServerSettingsCache method updateCache.
public synchronized void updateCache() {
DatabaseSession session = database.createSession(OperationType.READ_ONLY);
try {
serverSettings = session.getSingle(StorePackage.eINSTANCE.getServerSettings(), new OldQuery(session.getMetaDataManager().getPackageMetaData("store"), true));
if (serverSettings.getSessionTimeOutSeconds() == 0) {
serverSettings.setSessionTimeOutSeconds(60 * 60 * 24 * 30);
}
allowedHosts.clear();
for (String domain : serverSettings.getWhitelistedDomains()) {
allowedHosts.add(domain);
}
} catch (BimserverDatabaseException e) {
LOGGER.error("", e);
} finally {
session.close();
}
}
Aggregations