diskCleanupTask
@Bean
@ConditionalOnProperty(value="genie.tasks.disk-cleanup.enabled",
havingValue="true")
@ConditionalOnMissingBean(DiskCleanupTask.class)
public DiskCleanupTask diskCleanupTask(DiskCleanupProperties properties,
@Qualifier("genieTaskScheduler")
org.springframework.scheduling.TaskScheduler scheduler,
@Qualifier("jobsDir")
org.springframework.core.io.Resource jobsDir,
DataServices dataServices,
JobsProperties jobsProperties,
org.apache.commons.exec.Executor processExecutor,
io.micrometer.core.instrument.MeterRegistry registry)
throws java.io.IOException
- Parameters:
properties - The disk cleanup properties to use.
scheduler - The scheduler to use to schedule the cron trigger.
jobsDir - The resource representing the location of the job directory
dataServices - The DataServices instance to use
jobsProperties - The jobs properties to use
processExecutor - The process executor to use to delete directories
registry - The metrics registry
- Returns:
- The
DiskCleanupTask instance
- Throws:
java.io.IOException - When it is unable to open a file reference to the job directory