Nice one!
What do you think about moving the "expirationInterval" to a the
configuration table?
I can already imagine users asking "How can I configure a different time
interval" :)

Sebastian

---------- Forwarded message ----------
From: <[email protected]>
Date: 2012/5/16
Subject: svn commit: r1339020 -
/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/quartz/scheduler/TestSetupCleanupJob.java
To: [email protected]


Author: solomax
Date: Wed May 16 05:54:36 2012
New Revision: 1339020

URL: http://svn.apache.org/viewvc?rev=1339020&view=rev
Log:
OPENMEETINGS-70 only expired test setups are deleted

Modified:

 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/quartz/scheduler/TestSetupCleanupJob.java

Modified:
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/quartz/scheduler/TestSetupCleanupJob.java
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/quartz/scheduler/TestSetupCleanupJob.java?rev=1339020&r1=1339019&r2=1339020&view=diff
==============================================================================
---
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/quartz/scheduler/TestSetupCleanupJob.java
(original)
+++
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/quartz/scheduler/TestSetupCleanupJob.java
Wed May 16 05:54:36 2012
@@ -28,6 +28,7 @@ import org.slf4j.Logger;

 public class TestSetupCleanupJob {
       private static Logger log =
Red5LoggerFactory.getLogger(TestSetupCleanupJob.class,
OpenmeetingsVariables.webAppRootKey);
+       private long expirationInterval = 60 * 60 * 1000; // 1 hour

       public void doIt() {
               log.debug("TestSetupClearJob.execute");
@@ -43,9 +44,9 @@ public class TestSetupCleanupJob {
                                               }
                                       }))
                                       {
-                                               if (file.isFile()) {
-                                                       log.debug("TEST
SETUP found: " + file.getAbsolutePath());
-                                                       file.delete();
//deleted
+                                               if (file.isFile() &&
file.lastModified() + expirationInterval < System.currentTimeMillis()) {
+                                                       log.debug("expired
TEST SETUP found: " + file.getAbsolutePath());
+                                                       file.delete();
                                               }
                                       }
                               }





-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.openmeetings.de
http://www.webbase-design.de
http://www.wagner-sebastian.com
[email protected]

Reply via email to