Skip to content

Commit

Permalink
eraajocontroller-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
oplekal committed Nov 8, 2024
1 parent 307e111 commit 7a20789
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class EraAjoController {

@RequestMapping(value = "/{nimi}/execute", method = RequestMethod.GET)
public void executeTask(@PathVariable String nimi) {
tasks.get(nimi).execute();
tasks.get(nimi).executeAsync();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ public interface ScheduledTask {
int getPriority();
String getName();
void execute();
void executeAsync();
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import fi.vm.sade.eperusteet.service.exception.SkeduloituAjoAlreadyRunningException;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;

public abstract class AbstractScheduledTask implements ScheduledTask {

Expand Down Expand Up @@ -39,4 +40,11 @@ public void execute() {
throw e;
}
}

@Async
@IgnorePerusteUpdateCheck
@Override
public void executeAsync() {
execute();
}
}

0 comments on commit 7a20789

Please sign in to comment.