Skip to content

Commit

Permalink
add a scheduler to fix the stale workflow and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
ZihengSun committed Jul 10, 2024
1 parent e033baa commit 5e2b3c7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>
<groupId>com.gw</groupId>
<artifactId>geoweaver</artifactId>
<version>1.6.5</version>
<version>1.6.6</version>
<name>geoweaver</name>
<description>A lightweight workflow management software for organizing data analysis workflows,
preserving history of every workflow run, and improving scientist producitvity and workflow FAIRness,
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/com/gw/tasks/TaskManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -32,6 +36,8 @@ public class TaskManager {

private CopyOnWriteArrayList<Task> waitinglist;
private CopyOnWriteArrayList<Task> runninglist;
private ScheduledExecutorService scheduler; // Scheduler for periodic task checking


Logger logger = Logger.getLogger(this.getClass());

Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/static/js/gw.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",

Expand Down

0 comments on commit 5e2b3c7

Please sign in to comment.