summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java11
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbOrganization.java3
2 files changed, 11 insertions, 3 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java
index 472f2578..898f75e9 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java
@@ -43,6 +43,7 @@ import org.openslx.util.AppUtil;
import org.openslx.util.GrowingThreadPoolExecutor;
import org.openslx.util.PrioThreadFactory;
import org.openslx.util.QuickTimer;
+import org.openslx.util.QuickTimer.Task;
public class App {
@@ -144,6 +145,14 @@ public class App {
+ " Please make sure this server can connect to the internet.");
return;
}
+ // Update once an hour
+ QuickTimer.scheduleAtFixedDelay(new Task() {
+ public void fire() {
+ VirtualizerList.get();
+ OperatingSystemList.get();
+ OrganizationList.get();
+ }
+ }, 3601_000, 3601_000 * 3);
// Start file transfer server
if (!FileServer.instance().start()) {
@@ -152,7 +161,7 @@ public class App {
}
// Start watch dog to ensure nobody else is messing with the vmstore
- QuickTimer.scheduleAtFixedDelay(new StorageUseCheck(), 10000, 60000);
+ QuickTimer.scheduleAtFixedDelay(new StorageUseCheck(), 10_000, 60_000);
// Set a flag that we need to convert userids if applicable
DbUser.checkIfLegacyUsersExist();
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbOrganization.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbOrganization.java
index 7261b189..6d999573 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbOrganization.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbOrganization.java
@@ -26,7 +26,7 @@ public class DbOrganization {
* @return
* @throws SQLException
*/
- public static boolean storeOrganizations(List<Organization> organizations) throws SQLException {
+ public static void storeOrganizations(List<Organization> organizations) throws SQLException {
try (MysqlConnection connection = Database.getConnection()) {
MysqlStatement stmt = connection.prepareStatement("INSERT INTO organization"
+ " (organizationid, displayname, canlogin) VALUES (:id, :name, 0)"
@@ -37,7 +37,6 @@ public class DbOrganization {
stmt.executeUpdate();
}
connection.commit();
- return true;
} catch (SQLException e) {
LOGGER.error("Query failed in DbOrganization.storeOrganization()", e);
throw e;