diff options
author | Simon Rettberg | 2017-08-01 15:39:04 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-08-01 15:39:04 +0200 |
commit | edcdc2c5881a69a1b735f7e0571d8c409c1df49c (patch) | |
tree | 2729a449c693a2c779d57cf387cbacd6f9e08a49 | |
parent | [client] Log detailed runtime information on app startup (diff) | |
download | tutor-module-edcdc2c5881a69a1b735f7e0571d8c409c1df49c.tar.gz tutor-module-edcdc2c5881a69a1b735f7e0571d8c409c1df49c.tar.xz tutor-module-edcdc2c5881a69a1b735f7e0571d8c409c1df49c.zip |
[client] Only try sat server in OrgCache if it is set yet
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/thrift/cache/OrganizationCache.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/cache/OrganizationCache.java b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/cache/OrganizationCache.java index c76da623..f4e0a430 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/cache/OrganizationCache.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/cache/OrganizationCache.java @@ -5,6 +5,7 @@ import java.util.List; import org.apache.log4j.Logger; import org.openslx.bwlp.thrift.iface.Organization; +import org.openslx.bwlp.thrift.iface.SatelliteServer; import org.openslx.bwlp.thrift.iface.UserInfo; import org.openslx.dozmod.thrift.Sorters; import org.openslx.thrifthelper.ThriftManager; @@ -34,11 +35,16 @@ public class OrganizationCache { e); } if (orgs == null) { - try { - orgs = ThriftManager.getSatClient().getAllOrganizations(); - } catch (Exception e) { - LOGGER.error("Failed to get organization list from satellite server. ", e); - // both failed, can this ever happen? TODO if it does, what do we do? + SatelliteServer.Iface client = ThriftManager.getSatClient(); + if (client == null) { + LOGGER.warn("Satellite server not known yet."); + } else { + try { + orgs = client.getAllOrganizations(); + } catch (Exception e) { + LOGGER.error("Failed to get organization list from satellite server. ", e); + // both failed, can this ever happen? TODO if it does, what do we do? + } } } if (orgs != null) |