changed cron to 1h
This commit is contained in:
@@ -12,7 +12,7 @@ import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* Scheduled service for batch cleanup of expired sessions.
|
||||
* Runs every minute to delete expired sessions in batches to avoid long transactions.
|
||||
* Runs every hour to delete expired sessions in batches to avoid long transactions.
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@@ -29,10 +29,10 @@ public class SessionCleanupService {
|
||||
|
||||
/**
|
||||
* Batch deletes expired sessions.
|
||||
* Runs every minute at second 0.
|
||||
* Runs every hour at minute 0.
|
||||
* Processes up to MAX_BATCHES_PER_RUN batches per run.
|
||||
*/
|
||||
@Scheduled(cron = "0 * * * * ?") // Every minute at second 0
|
||||
@Scheduled(cron = "0 0 * * * ?") // Every hour at minute 0
|
||||
@Transactional
|
||||
public void cleanupExpiredSessions() {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
Reference in New Issue
Block a user