CRON job voor het schonen van de logging
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package nl.veenm.jobfindr.util;
|
||||
|
||||
import io.quarkus.scheduler.Scheduled;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.transaction.Transactional;
|
||||
import nl.veenm.jobfindr.domain.Event;
|
||||
import nl.veenm.jobfindr.repository.EventRepository;
|
||||
|
||||
@@ -57,7 +59,16 @@ public class EventService {
|
||||
saveEvent(event);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
private void saveEvent(Event event) {
|
||||
eventRepository.persist(event);
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 00 00 ? * 1#1")
|
||||
@Transactional
|
||||
private void cleanEvents() {
|
||||
eventRepository.deleteAll();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user