Skip to content

Allow custom cron expression for cleanup task #616

Closed
@ajthom90

Description

@ajthom90

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions