diff --git a/pom.xml b/pom.xml index 4cea5f52..952c471d 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ com.gw geoweaver - 1.6.5 + 1.6.6 geoweaver A lightweight workflow management software for organizing data analysis workflows, preserving history of every workflow run, and improving scientist producitvity and workflow FAIRness, diff --git a/src/main/java/com/gw/tasks/TaskManager.java b/src/main/java/com/gw/tasks/TaskManager.java index c3a6edef..54ed89ea 100644 --- a/src/main/java/com/gw/tasks/TaskManager.java +++ b/src/main/java/com/gw/tasks/TaskManager.java @@ -11,6 +11,10 @@ import java.util.List; import java.util.Optional; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -32,6 +36,8 @@ public class TaskManager { private CopyOnWriteArrayList waitinglist; private CopyOnWriteArrayList runninglist; + private ScheduledExecutorService scheduler; // Scheduler for periodic task checking + Logger logger = Logger.getLogger(this.getClass()); @@ -49,6 +55,16 @@ public class TaskManager { runninglist = new CopyOnWriteArrayList(); } + public TaskManager() { + this.init(); + } + + private void init() { + // Initialize the scheduler + scheduler = Executors.newScheduledThreadPool(1); + scheduler.scheduleAtFixedRate(this::notifyWaitinglist, 0, 1, TimeUnit.MINUTES); + } + /** Add a new task to the waiting list */ public void addANewTask(Task t) { // t.addObserver(wto); diff --git a/src/main/resources/static/js/gw.js b/src/main/resources/static/js/gw.js index 9281b0d6..49599ee8 100644 --- a/src/main/resources/static/js/gw.js +++ b/src/main/resources/static/js/gw.js @@ -9,7 +9,7 @@ edu = { sponsor: "ESIPLab incubator project, NASA ACCESS project, NSF Geoinformatics project, NSF Cybertraining project", - version: "1.6.5", + version: "1.6.6", author: "open source contributors",