-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GRAD2-2395: task is complete
- Loading branch information
Showing
10 changed files
with
161 additions
and
86 deletions.
There are no files selected for viewing
12 changes: 3 additions & 9 deletions
12
api/src/main/java/ca/bc/gov/educ/api/batchgraduation/config/AsyncConfig.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 |
---|---|---|
@@ -1,24 +1,18 @@ | ||
package ca.bc.gov.educ.api.batchgraduation.config; | ||
|
||
import ca.bc.gov.educ.api.batchgraduation.util.EducGradBatchGraduationApiConstants; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.core.task.SimpleAsyncTaskExecutor; | ||
import org.springframework.core.task.TaskExecutor; | ||
import org.springframework.scheduling.annotation.EnableAsync; | ||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | ||
|
||
@Configuration | ||
@EnableAsync | ||
@Profile("!test") | ||
public class AsyncConfig { | ||
@Bean(name = "asyncExecutor") | ||
public TaskExecutor asyncExecutor(EducGradBatchGraduationApiConstants constants) { | ||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); | ||
executor.setCorePoolSize(constants.getNumberOfPartitions()); | ||
executor.setMaxPoolSize(constants.getNumberOfPartitions()); | ||
executor.setThreadNamePrefix("async-"); | ||
executor.initialize(); | ||
return executor; | ||
public TaskExecutor asyncExecutor() { | ||
return new SimpleAsyncTaskExecutor("async-"); | ||
} | ||
} |
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
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
14 changes: 14 additions & 0 deletions
14
...main/java/ca/bc/gov/educ/api/batchgraduation/repository/BatchStepExecutionRepository.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,14 @@ | ||
package ca.bc.gov.educ.api.batchgraduation.repository; | ||
|
||
import ca.bc.gov.educ.api.batchgraduation.entity.BatchStepExecutionEntity; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.List; | ||
|
||
@Repository | ||
public interface BatchStepExecutionRepository extends JpaRepository<BatchStepExecutionEntity, Long> { | ||
|
||
List<BatchStepExecutionEntity> findByJobExecutionIdOrderByEndTimeDesc(Long jobExecutionId); | ||
|
||
} |
Oops, something went wrong.