All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.otto.edison.jobs.repository.cleanup.CleanupMessagesOfTooBigJobLogs Maven / Gradle / Ivy

The newest version!
package de.otto.edison.jobs.repository.cleanup;

import de.otto.edison.jobs.service.JobService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;

public class CleanupMessagesOfTooBigJobLogs implements JobCleanupStrategy {

    private static final Logger LOG = LoggerFactory.getLogger(CleanupMessagesOfTooBigJobLogs.class);
    private static final long FIND_TOO_LONG_LOGS_INTERVAL = 5L * 60L * 1000L; // Every 5 minutes

    private final JobService jobService;

    public CleanupMessagesOfTooBigJobLogs(final JobService jobService) {
        this.jobService = jobService;
        LOG.info("Init CleanupMessagesOfTooBigJobLogs JobCleanupStrategy.");
    }

    @Override
    @Scheduled(fixedRate = FIND_TOO_LONG_LOGS_INTERVAL)
    public void doCleanUp() {
        jobService.handleTooBigJobLogs();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy