Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M. Finkbeiner2016-09-16 18:06:48 -0400
committerAndrew M. Finkbeiner2016-10-06 21:12:15 -0400
commitc2a43a5dc2615aa3b5aa8927ba7f8f938b59f646 (patch)
treeede67992c7d004601b2c696e188aae6c394dd93a
parentc84f1ba8ba1aa88e1f3ec114a9af59109c9f562a (diff)
downloadorg.eclipse.osee-c2a43a5dc2615aa3b5aa8927ba7f8f938b59f646.tar.gz
org.eclipse.osee-c2a43a5dc2615aa3b5aa8927ba7f8f938b59f646.tar.xz
org.eclipse.osee-c2a43a5dc2615aa3b5aa8927ba7f8f938b59f646.zip
bug[ats_ATS312436]: OTE Server Folder cleanup is not working
-rw-r--r--plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTests.java3
-rw-r--r--plugins/org.eclipse.osee.ote.io/src/org/eclipse/osee/ote/io/internal/OTEFolderImpl.java7
2 files changed, 7 insertions, 3 deletions
diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTests.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTests.java
index 462dde7ccf..2319f8e26e 100644
--- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTests.java
+++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTests.java
@@ -219,8 +219,7 @@ public class RunTests implements ITestServerCommand, Serializable {
}
private String getTestType(){
- IPropertyStore props = scripts.get(0);
- return props.get("FormalTestType");
+ return global.get("FormalTestType");
}
private boolean isFolderToKeep(String testType) {
diff --git a/plugins/org.eclipse.osee.ote.io/src/org/eclipse/osee/ote/io/internal/OTEFolderImpl.java b/plugins/org.eclipse.osee.ote.io/src/org/eclipse/osee/ote/io/internal/OTEFolderImpl.java
index a8478c12f4..592314f243 100644
--- a/plugins/org.eclipse.osee.ote.io/src/org/eclipse/osee/ote/io/internal/OTEFolderImpl.java
+++ b/plugins/org.eclipse.osee.ote.io/src/org/eclipse/osee/ote/io/internal/OTEFolderImpl.java
@@ -104,18 +104,21 @@ public class OTEFolderImpl implements OTEServerFolder{
@Override
public void cleanOldBatchFolders(){
Date dateBefore = new Date(new Date().getTime() -(DAYS * 24 * 3600 * 1000));
+ Date dateNoMatterwhat = new Date(new Date().getTime() -(28L * 24L * 3600L * 1000L));//4 weeks
if(BATCHES.exists()){
File[] files = BATCHES.listFiles();
if(files != null){
for(File file:files){
if(file.isDirectory()){
boolean olderFileOrUnknown = true;
+ boolean removeNoMatterWhat = false;
try {
Date fileDate = format.parse(file.getName());
if(fileDate == null){
OseeLog.log(getClass(), Level.WARNING, "Failed to parse a date from the Dir name "+ file.getAbsolutePath());
} else {
olderFileOrUnknown = fileDate.before(dateBefore);
+ removeNoMatterWhat = fileDate.before(dateNoMatterwhat);
}
} catch (ParseException e) {
int index = file.getName().lastIndexOf("__");
@@ -126,6 +129,7 @@ public class OTEFolderImpl implements OTEServerFolder{
OseeLog.log(getClass(), Level.WARNING, "Failed to parse a date from the Dir name "+ file.getAbsolutePath());
} else {
olderFileOrUnknown = fileDate.before(dateBefore);
+ removeNoMatterWhat = fileDate.before(dateNoMatterwhat);
}
} catch (ParseException e2){
OseeLog.log(getClass(), Level.SEVERE, e2);
@@ -136,7 +140,7 @@ public class OTEFolderImpl implements OTEServerFolder{
}
File delete = new File(file, DELETE_MARKER);
boolean deleteFolder = delete.exists();
- if(deleteFolder && olderFileOrUnknown){
+ if((deleteFolder && olderFileOrUnknown) || removeNoMatterWhat){
File[] toDelete = file.listFiles();
for(File f:toDelete){
f.delete();
@@ -176,6 +180,7 @@ public class OTEFolderImpl implements OTEServerFolder{
OseeLog.log(getClass(), Level.WARNING, "Failed to parse a date from the Dir name "+ file.getAbsolutePath());
} else {
olderFileOrUnknown = fileDate.before(dateBefore);
+ removeNoMatterWhat = fileDate.before(dateNoMatterwhat);
}
} catch (ParseException e2){
OseeLog.log(getClass(), Level.SEVERE, e2);

Back to the top