Search in sources :

Example 31 with Scheduled

use of org.springframework.scheduling.annotation.Scheduled in project mica2 by obiba.

the class TempFileService method cleanupTempFiles.

@Scheduled(fixedDelay = TEMP_FILE_CLEANUP_INTERVAL)
public void cleanupTempFiles() {
    log.debug("Cleaning up tempfiles");
    List<TempFile> tempFiles = tempFileRepository.findByCreatedDateLessThan(DateTime.now().minusHours(TEMP_FILE_EXPIRE_TIMEOUT), new PageRequest(0, 100));
    tempFiles.forEach(f -> tempFileRepository.delete(f));
}
Also used : PageRequest(org.springframework.data.domain.PageRequest) TempFile(org.obiba.mica.file.TempFile) Scheduled(org.springframework.scheduling.annotation.Scheduled)

Aggregations

Scheduled (org.springframework.scheduling.annotation.Scheduled)31 Date (java.util.Date)8 Nabaztag (com.nabalive.data.core.model.Nabaztag)4 IOException (java.io.IOException)4 Application (com.nabalive.application.core.Application)3 Status (com.nabalive.server.jabber.Status)3 File (java.io.File)3 SimpleDateFormat (java.text.SimpleDateFormat)3 ArrayList (java.util.ArrayList)3 DisruptorBindEvent (com.lmax.disruptor.spring.boot.event.DisruptorBindEvent)2 BigDecimal (java.math.BigDecimal)2 DateFormat (java.text.DateFormat)2 LocalDate (java.time.LocalDate)2 Map (java.util.Map)2 ExecutionException (java.util.concurrent.ExecutionException)2 GroupList (org.apache.rocketmq.common.protocol.body.GroupList)2 TopicList (org.apache.rocketmq.common.protocol.body.TopicList)2 BrokerData (org.apache.rocketmq.common.protocol.route.BrokerData)2 SpeciesListDTO (au.org.ala.spatial.dto.SpeciesListDTO)1 Capture (co.videofirst.vft.capture.model.capture.Capture)1