Example usage for org.springframework.scheduling.config ScheduledTaskRegistrar addCronTask

List of usage examples for org.springframework.scheduling.config ScheduledTaskRegistrar addCronTask

Introduction

In this page you can find the example usage for org.springframework.scheduling.config ScheduledTaskRegistrar addCronTask.

Prototype

public void addCronTask(Runnable task, String expression) 

Source Link

Document

Add a Runnable task to be triggered per the given cron expression.

Usage

From source file:org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration.java

@Override
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
    taskRegistrar.addCronTask(() -> sessionRepository().cleanupExpiredSessions(), this.cleanupCron);
}