Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COL-182 scheduled cron job annotated like in Wegas #571

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
import ch.colabproject.colab.api.controller.monitoring.CronJobLogManager;
import ch.colabproject.colab.api.model.monitoring.CronJobLogName;
import ch.colabproject.colab.api.security.SessionManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.ejb.Schedule;
import javax.ejb.Singleton;
import javax.ejb.Startup;
import javax.inject.Inject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Do periodic tasks
Expand Down Expand Up @@ -44,7 +45,7 @@ public class CronTab {
/**
* Each minute
*/
@Schedule(hour = "*", minute = "*")
@Schedule(hour = "*", minute = "*", persistent = false)
public void saveActivityDates() {
logger.trace("CRON: Persist activity dates to database");
sessionManager.writeActivityDatesToDatabase();
Expand All @@ -54,7 +55,7 @@ public void saveActivityDates() {
/**
* each midnight, clear expired sessions
*/
@Schedule(hour = "0", minute = "0")
@Schedule(hour = "0", minute = "0", persistent = false)
public void dropOldHttpSession() {
logger.info("CRON: drop expired http session");
sessionManager.clearExpiredHttpSessions();
Expand All @@ -64,7 +65,7 @@ public void dropOldHttpSession() {
/**
* each 00:30, clean outdated UrlMetadata
*/
@Schedule(hour = "0", minute = "30")
@Schedule(hour = "0", minute = "30", persistent = false)
public void dropOldUrlMetadata() {
logger.info("CRON: clean url metadata cache");
externalDataManager.clearOutdated();
Expand Down