-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update README.md * clean tmp graphs in case of error and on startup * relax jacoco * relax jacoco
- Loading branch information
Showing
9 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/it/gov/innovazione/ndc/harvester/service/startupjob/StartupJob.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package it.gov.innovazione.ndc.harvester.service.startupjob; | ||
|
||
public interface StartupJob { | ||
|
||
void run(); | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/it/gov/innovazione/ndc/harvester/service/startupjob/StartupJobsRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package it.gov.innovazione.ndc.harvester.service.startupjob; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.boot.context.event.ApplicationStartedEvent; | ||
import org.springframework.context.event.EventListener; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.List; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class StartupJobsRunner { | ||
|
||
private final List<StartupJob> startupJobs; | ||
|
||
@EventListener(ApplicationStartedEvent.class) | ||
public void run() { | ||
startupJobs.forEach(StartupJob::run); | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/it/gov/innovazione/ndc/harvester/service/startupjob/TempEraserStartupJob.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package it.gov.innovazione.ndc.harvester.service.startupjob; | ||
|
||
import it.gov.innovazione.ndc.harvester.HarvesterService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class TempEraserStartupJob implements StartupJob { | ||
|
||
private final HarvesterService harvesterService; | ||
|
||
@Override | ||
public void run() { | ||
harvesterService.cleanTempGraphsForConfiguredRepo(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters