This repository has been archived by the owner on Oct 29, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...nent-shared/src/java/org/sakaiproject/component/app/scheduler/jobs/SessionCleanupJob.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.sakaiproject.component.app.scheduler.jobs; | ||
|
||
import org.quartz.JobExecutionContext; | ||
import org.quartz.JobExecutionException; | ||
import org.quartz.StatefulJob; | ||
import org.sakaiproject.event.api.UsageSessionService; | ||
|
||
/** | ||
* Job to cleanup old sessions from the database. | ||
* Outside of the session service as when merging into K1 jobscheduler won't be available. | ||
* @author buckett | ||
* | ||
*/ | ||
public class SessionCleanupJob implements StatefulJob { | ||
|
||
private UsageSessionService usageSessionService; | ||
|
||
public void setUsageSessionService(UsageSessionService usageSessionService) { | ||
this.usageSessionService = usageSessionService; | ||
} | ||
|
||
public void execute(JobExecutionContext context) throws JobExecutionException { | ||
usageSessionService.cleanupSessions(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters