Class JobService
java.lang.Object
com.bluebell.greenhouse.radicle.services.AbstractGenericEntityService<Job, JobRepository>
com.bluebell.greenhouse.radicle.services.job.JobService
@Service
@Transactional(readOnly=true)
public class JobService
extends AbstractGenericEntityService<Job, JobRepository>
Read and retention service for durable
Job attempts. Execution belongs to the durable
lifecycle services; nothing here runs work.- Version:
- 3.0.6
- Author:
- Stephen Prizio
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintDeletes terminal attempts older than the configured lookback period.intDeletes attempts that are still marked as running a week after they started.findJobByJobId(String jobId) Finds aJobby its job id.org.springframework.data.domain.Page<Job> searchJobs(JobFilter filter, int page, int pageSize, org.springframework.data.domain.Sort sort) Returns a paginatedPageofJobs matching the given filter.Methods inherited from class AbstractGenericEntityService
refreshEntity, resolveEntity, resolveEntity, resolveEntity
-
Constructor Details
-
JobService
Creates the service.- Parameters:
jobRepository-JobRepository
-
-
Method Details
-
deleteStaleRunningJobs
@Transactional public int deleteStaleRunningJobs()Deletes attempts that are still marked as running a week after they started. Lease recovery moves abandoned work to a terminal state within minutes, so anything still running after a week is residue rather than work in flight.- Returns:
- count of deleted attempts
-
deleteOldJobs
@Transactional public int deleteOldJobs()Deletes terminal attempts older than the configured lookback period.- Returns:
- count of deleted attempts
-
findJobByJobId
-
searchJobs
-