@ConditionalOnProperty(value="genie.tasks.databaseCleanup.enabled")
@Component
public class DiskCleanupTask
extends java.lang.Object
implements java.lang.Runnable
Constructor and Description |
---|
DiskCleanupTask(DiskCleanupProperties properties,
org.springframework.scheduling.TaskScheduler scheduler,
org.springframework.core.io.Resource jobsDir,
JobSearchService jobSearchService,
JobsProperties jobsProperties,
org.apache.commons.exec.Executor processExecutor,
com.netflix.spectator.api.Registry registry)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
run()
Checks the disk for jobs on this host.
|
@Autowired public DiskCleanupTask(@NotNull DiskCleanupProperties properties, @Qualifier(value="genieTaskScheduler") @NotNull org.springframework.scheduling.TaskScheduler scheduler, @NotNull org.springframework.core.io.Resource jobsDir, @NotNull JobSearchService jobSearchService, @NotNull JobsProperties jobsProperties, @NotNull org.apache.commons.exec.Executor processExecutor, @NotNull com.netflix.spectator.api.Registry registry) throws java.io.IOException
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 directoryjobSearchService
- The service to find jobs withjobsProperties
- The jobs properties to useprocessExecutor
- The process executor to use to delete directoriesregistry
- The metrics registryjava.io.IOException
- When it is unable to open a file reference to the job directory