Class BackgroundJobCleaner
- java.lang.Object
-
- com.atlassian.confluence.impl.backgroundjob.BackgroundJobCleaner
-
- All Implemented Interfaces:
BackgroundJobProcessor
public class BackgroundJobCleaner extends Object implements BackgroundJobProcessor
Removes non-active background jobs older than 7 days.- Since:
- 8.1.0
-
-
Constructor Summary
Constructors Constructor Description BackgroundJobCleaner(BackgroundJobDAO backgroundJobDAO)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isSingleton()
When it returns true, the background job service will create a record with a job if does not exist.BackgroundJobResponse
process(Long jobId, Map<String,Object> parameters, long recommendedTimeout)
This method does the actual background operations.
-
-
-
Constructor Detail
-
BackgroundJobCleaner
public BackgroundJobCleaner(BackgroundJobDAO backgroundJobDAO)
-
-
Method Detail
-
process
public BackgroundJobResponse process(Long jobId, Map<String,Object> parameters, long recommendedTimeout)
Description copied from interface:BackgroundJobProcessor
This method does the actual background operations. Need to stop its execution after recommendedTimeout timeout. This method is run inside a RW transaction. If something goes wrong, the method has to simply throw a runtime exception, it will be properly handled by the scheduler (logged, re-scheduled next run etc).- Specified by:
process
in interfaceBackgroundJobProcessor
- Parameters:
jobId
- background job idparameters
- background job parametersrecommendedTimeout
- timeout in milliseconds- Returns:
- response
-
isSingleton
public boolean isSingleton()
Description copied from interface:BackgroundJobProcessor
When it returns true, the background job service will create a record with a job if does not exist. Useful for tasks that have to be run periodically.- Specified by:
isSingleton
in interfaceBackgroundJobProcessor
-
-