summaryrefslogtreecommitdiffstats
path: root/dozentenmodulserver
diff options
context:
space:
mode:
authorSimon Rettberg2015-08-25 18:45:10 +0200
committerSimon Rettberg2015-08-25 18:45:10 +0200
commit1cc3a5cf839bea72093e0d604f8b041dc74bae85 (patch)
treea72d5fb507f2fb28466ce6f0c53af7769025e770 /dozentenmodulserver
parent[server] Group image version delete on deleteImageBase (diff)
downloadtutor-module-1cc3a5cf839bea72093e0d604f8b041dc74bae85.tar.gz
tutor-module-1cc3a5cf839bea72093e0d604f8b041dc74bae85.tar.xz
tutor-module-1cc3a5cf839bea72093e0d604f8b041dc74bae85.zip
[server] Reduce spam when fetching OS and Virt list from master
Diffstat (limited to 'dozentenmodulserver')
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OperatingSystemList.java4
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/VirtualizerList.java31
2 files changed, 20 insertions, 15 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OperatingSystemList.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OperatingSystemList.java
index 903db0c5..2f6bbdbc 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OperatingSystemList.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OperatingSystemList.java
@@ -5,6 +5,7 @@ import java.util.List;
import org.apache.log4j.Logger;
import org.apache.thrift.TException;
+import org.apache.thrift.transport.TTransportException;
import org.openslx.bwlp.sat.database.mappers.DbOsVirt;
import org.openslx.bwlp.thrift.iface.OperatingSystem;
import org.openslx.thrifthelper.ThriftManager;
@@ -31,7 +32,8 @@ public class OperatingSystemList extends CacheBase<List<OperatingSystem>> {
try {
list = ThriftManager.getMasterClient().getOperatingSystems();
} catch (TException e1) {
- LOGGER.warn("Could not fetch OS list from master, using local data...", e1);
+ LOGGER.warn("Could not fetch OS list from master, using local data...",
+ e1 instanceof TTransportException ? null : e1);
try {
return DbOsVirt.getOsList();
} catch (SQLException e) {
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/VirtualizerList.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/VirtualizerList.java
index 469096d8..28463e6b 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/VirtualizerList.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/VirtualizerList.java
@@ -1,14 +1,16 @@
package org.openslx.bwlp.sat.thrift.cache;
+import java.sql.SQLException;
import java.util.List;
-import org.apache.log4j.Logger;
-
-import org.openslx.bwlp.sat.database.mappers.DbOsVirt;
-import java.sql.SQLException;
+import org.apache.log4j.Logger;
import org.apache.thrift.TException;
+import org.apache.thrift.transport.TTransportException;
+import org.openslx.bwlp.sat.database.mappers.DbOsVirt;
import org.openslx.bwlp.thrift.iface.Virtualizer;
import org.openslx.thrifthelper.ThriftManager;
+import org.openslx.util.QuickTimer;
+import org.openslx.util.QuickTimer.Task;
/**
* Holds the list of all known virtualizers. The list is synchronized with
@@ -30,7 +32,8 @@ public class VirtualizerList extends CacheBase<List<Virtualizer>> {
try {
list = ThriftManager.getMasterClient().getVirtualizers();
} catch (TException e1) {
- LOGGER.warn("Could not fetch Virtualizer list from master, using local data...", e1);
+ LOGGER.warn("Could not fetch Virtualizer list from master, using local data...",
+ e1 instanceof TTransportException ? null : e1);
try {
return DbOsVirt.getVirtualizerList();
} catch (SQLException e) {
@@ -38,15 +41,15 @@ public class VirtualizerList extends CacheBase<List<Virtualizer>> {
}
return null;
}
-// QuickTimer.scheduleOnce(new Task() {
-// @Override
-// public void fire() {
-// try {
-// DbOsVirt.storeOsList(list);
-// } catch (SQLException e) {
-// }
-// }
-// });
+ QuickTimer.scheduleOnce(new Task() {
+ @Override
+ public void fire() {
+ try {
+ DbOsVirt.storeVirtualizerList(list);
+ } catch (SQLException e) {
+ }
+ }
+ });
return list;
}