File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
src/main/java/org/commonwl/view Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 23
23
import org .springframework .boot .autoconfigure .SpringBootApplication ;
24
24
import org .springframework .data .mongodb .repository .config .EnableMongoRepositories ;
25
25
import org .springframework .scheduling .annotation .EnableAsync ;
26
+ import org .springframework .scheduling .annotation .EnableScheduling ;
26
27
27
28
@ SpringBootApplication
28
29
@ EnableMongoRepositories
29
30
@ EnableAsync
31
+ @ EnableScheduling
30
32
public class CwlViewerApplication {
31
33
32
34
public static void main (String [] args ) {
Original file line number Diff line number Diff line change
1
+ package org .commonwl .view .workflow ;
2
+
3
+
4
+ import org .springframework .beans .factory .annotation .Autowired ;
5
+ import org .springframework .scheduling .annotation .Scheduled ;
6
+ import org .springframework .stereotype .Component ;
7
+
8
+ import java .util .Date ;
9
+
10
+ @ Component
11
+ public class Scheduler {
12
+
13
+ private final QueuedWorkflowRepository queuedWorkflowRepository ;
14
+
15
+ @ Autowired
16
+ public Scheduler (QueuedWorkflowRepository queuedWorkflowRepository ) {
17
+ this .queuedWorkflowRepository = queuedWorkflowRepository ;
18
+ }
19
+
20
+ @ Scheduled (cron = "* * * * * ?" )
21
+ public void removeOldQueuedWorkflowEntries () {
22
+ Date now = new Date ();
23
+ System .out .println ("The time is " + now );
24
+ System .out .println ("The repository is " + queuedWorkflowRepository .toString ());
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments