You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openmeetings.apache.org by "seba.wagner@gmail.com" <se...@gmail.com> on 2012/05/16 09:03:24 UTC
Fwd: svn commit: r1339020 - /incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/quartz/scheduler/TestSetupCleanupJob.java
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: <so...@apache.org>
Date: 2012/5/16
Subject: svn commit: r1339020 -
/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/quartz/scheduler/TestSetupCleanupJob.java
To: openmeetings-commits@incubator.apache.org
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
seba.wagner@gmail.com
Re: svn commit: r1339020 - /incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/quartz/scheduler/TestSetupCleanupJob.java
Posted by Maxim Solodovnik <so...@gmail.com>.
I thought of moving it to the openmeetings-application.xml, but think it is
better to wait.
Not sure if it is necessary or not.
I can add it if you feel it should be done
On Wed, May 16, 2012 at 2:03 PM, seba.wagner@gmail.com <
seba.wagner@gmail.com> wrote:
> 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: <so...@apache.org>
> Date: 2012/5/16
> Subject: svn commit: r1339020 -
> /incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/quartz/scheduler/TestSetupCleanupJob.java
> To: openmeetings-commits@incubator.apache.org
>
>
> 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
> seba.wagner@gmail.com
>
--
WBR
Maxim aka solomax