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();
                                                }
                                        }
                                }


Reply via email to