From 9a660c9c114e17072120b6dc166474a12d7796f0 Mon Sep 17 00:00:00 2001 From: Julian Hochstetter <julian.hochstetter@mni.thm.de> Date: Wed, 19 Sep 2012 12:02:38 +0200 Subject: [PATCH] Task #3890: configurable cleanup delay --- src/main/java/de/thm/arsnova/services/SessionService.java | 8 +++++++- src/main/webapp/arsnova.properties.example | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/thm/arsnova/services/SessionService.java b/src/main/java/de/thm/arsnova/services/SessionService.java index 55a22c3ef..accb4cd24 100644 --- a/src/main/java/de/thm/arsnova/services/SessionService.java +++ b/src/main/java/de/thm/arsnova/services/SessionService.java @@ -64,6 +64,12 @@ public class SessionService implements ISessionService { @Autowired ARSnovaSocketIOServer server; + /** + * minutes, after which the feedback is deleted + */ + @Value("${feedback.cleanup}") + private int cleanupFeedbackDelay; + private String databaseHost; private int databasePort; private String databaseName; @@ -98,7 +104,7 @@ public class SessionService implements ISessionService { @Override @Scheduled(fixedDelay=5000) public void cleanFeedbackVotes() { - final long timelimitInMillis = /*10 * 60 **/ 10000; + final long timelimitInMillis = 60000 * cleanupFeedbackDelay; final long maxAllowedTimeInMillis = System.currentTimeMillis() - timelimitInMillis; Map<String, Set<String>> affectedUsers = new HashMap<String, Set<String>>(); diff --git a/src/main/webapp/arsnova.properties.example b/src/main/webapp/arsnova.properties.example index 5042b97f5..9133b8352 100644 --- a/src/main/webapp/arsnova.properties.example +++ b/src/main/webapp/arsnova.properties.example @@ -14,6 +14,9 @@ security.ssl=false security.keystore=/etc/arsnova.thm.de.jks security.storepass=arsnova +# minutes, after which the feedback is deleted +feedback.cleanup=10 + couchdb.host=localhost couchdb.port=5984 couchdb.name=arsnova \ No newline at end of file -- GitLab