Skip to content

Commit 5aa58c5

Browse files
committed
Add delete by date retrieved on method to queued workflow repository
1 parent 6ecad6d commit 5aa58c5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/main/java/org/commonwl/view/workflow/QueuedWorkflowRepository.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
import org.springframework.data.mongodb.repository.Query;
55
import org.springframework.data.repository.PagingAndSortingRepository;
66

7+
import java.util.Date;
8+
import java.util.List;
9+
710
/**
811
* Stores workflows in the queue waiting for cwltool
912
*/
@@ -24,4 +27,20 @@ public interface QueuedWorkflowRepository extends PagingAndSortingRepository<Que
2427
@Query("{tempRepresentation.retrievedFrom: ?0}")
2528
void deleteByRetrievedFrom(GitDetails retrievedFrom);
2629

30+
/**
31+
* Deletes all queued workflows with date retrieved on older or equal to the Date argument passed.
32+
* @param retrievedOn Date of when the queued workflow was retrieved
33+
* @return The number of queued workflows deleted
34+
*/
35+
Long deleteByTempRepresentation_RetrievedOnLessThanEqual(Date retrievedOn);
36+
37+
38+
/**
39+
* Finds and returns all queued workflows with date retrieved on older or equal to the Date argument passed.
40+
* @param retrievedOn Details of where the queued workflow is from
41+
* @return A list of queued workflows
42+
*/
43+
List<QueuedWorkflow> findByTempRepresentation_RetrievedOnLessThanEqual(Date retrievedOn);
44+
45+
2746
}

0 commit comments

Comments
 (0)