Search in sources :

Example 1 with DaemonScheduled

use of io.vertigo.commons.daemon.DaemonScheduled in project vertigo by KleeGroup.

the class FileManagerImpl method deleteOldFiles.

/**
 * Daemon for deleting old files.
 */
@DaemonScheduled(name = "DMN_PRUGE_TEMP_FILE", periodInSeconds = 5 * 60)
public void deleteOldFiles() {
    final File documentRootFile = new File(TempFile.VERTIGO_TMP_DIR_PATH);
    final long maxTime = System.currentTimeMillis() - purgeDelayMinutesOpt.orElse(60) * 60L * 1000L;
    doDeleteOldFiles(documentRootFile, maxTime);
}
Also used : VFile(io.vertigo.dynamo.file.model.VFile) File(java.io.File) TempFile(io.vertigo.util.TempFile) FSFile(io.vertigo.dynamo.impl.file.model.FSFile) StreamFile(io.vertigo.dynamo.impl.file.model.StreamFile) DaemonScheduled(io.vertigo.commons.daemon.DaemonScheduled)

Example 2 with DaemonScheduled

use of io.vertigo.commons.daemon.DaemonScheduled in project vertigo by KleeGroup.

the class FsFullFileStorePlugin method deleteOldFiles.

/**
 * Daemon to purge old files
 */
@DaemonScheduled(name = "DMN_PURGE_FILE_STORE_DAEMON_", periodInSeconds = 5 * 60)
public void deleteOldFiles() {
    if (purgeDelayMinutesOpt.isPresent()) {
        final File documentRootFile = new File(documentRoot);
        final long maxTime = System.currentTimeMillis() - purgeDelayMinutesOpt.get() * 60L * 1000L;
        doDeleteOldFiles(documentRootFile, maxTime);
    }
}
Also used : VFile(io.vertigo.dynamo.file.model.VFile) File(java.io.File) DaemonScheduled(io.vertigo.commons.daemon.DaemonScheduled)

Aggregations

DaemonScheduled (io.vertigo.commons.daemon.DaemonScheduled)2 VFile (io.vertigo.dynamo.file.model.VFile)2 File (java.io.File)2 FSFile (io.vertigo.dynamo.impl.file.model.FSFile)1 StreamFile (io.vertigo.dynamo.impl.file.model.StreamFile)1 TempFile (io.vertigo.util.TempFile)1