Closed
Description
Updated Description
Use spring.session.cleanup.cron.expression
property to override the cleanup task cron expression.
Original Description
I have a Spring Boot application using Spring Session 1.2.1.RELEASE. I have two servers running the application behind a load balancer, and the session information is stored in MySQL databases that use master-master replication. When the Scheduled task runs to delete sessions (JdbcOperationsSessionRepository.cleanUpExpiredSessions()), it runs on both web servers, which then tries to run on both databases and the replication runs into issues.
It would be nice to be able to set a system property so the scheduled cleanUpExpiredSessions() method will only run on one database, and MySQL replication will take care of the rest behind the scenes.