Skip to content

Commit

Permalink
Merge pull request #7395 from alrossi/fix/9.2/bulk-archiver-delete-bug
Browse files Browse the repository at this point in the history
dcache-bulk: fix bug in archiver deletion query
  • Loading branch information
svemeyer authored Oct 18, 2023
2 parents 3278975 + b3a1bb7 commit 6d19331
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING

import static org.dcache.services.bulk.BulkRequestStatus.CANCELLED;
import static org.dcache.services.bulk.BulkRequestStatus.COMPLETED;
import static org.dcache.services.bulk.BulkRequestStatus.INCOMPLETE;

import dmg.cells.nucleus.CellInfoProvider;
import java.io.PrintWriter;
Expand Down Expand Up @@ -160,7 +159,7 @@ public void run() {
long threshhold = System.currentTimeMillis() - archiverWindowUnit.toMillis(archiverWindow);

List<String> expiredUids = requestDao.getUids(
requestDao.where().modifiedBefore(threshhold).status(INCOMPLETE, COMPLETED, CANCELLED),
requestDao.where().modifiedBefore(threshhold).status(COMPLETED, CANCELLED),
Integer.MAX_VALUE);

/*
Expand All @@ -169,9 +168,9 @@ public void run() {
expiredUids.forEach(this::insert);

/*
* Delete all the out-of-date requests.
* Delete all the out-of-date requests which are terminal.
*/
requestDao.delete(requestDao.where().modifiedBefore(threshhold));
requestDao.delete(requestDao.where().modifiedBefore(threshhold).status(COMPLETED, CANCELLED));
lastRunCompleted = System.currentTimeMillis();
}

Expand Down

0 comments on commit 6d19331

Please sign in to comment.