Skip to content

Commit

Permalink
remove guice for task scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
chengw-netflix committed Mar 31, 2023
1 parent c489748 commit ba5ca4f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ public void addTaskWithDelay(
}

public void runTaskNow(Class<? extends Task> taskclass) throws Exception {
jobFactory.guice.getInstance(taskclass).execute(null);
// Create a new instance of the task using reflection
Task taskInstance = taskclass.getDeclaredConstructor().newInstance();
// Call the execute method on the instance
taskInstance.execute(null);
}

public void deleteTask(String name) throws SchedulerException {
Expand Down

0 comments on commit ba5ca4f

Please sign in to comment.