Skip to content

Commit

Permalink
Optimize session table during nightly cron
Browse files Browse the repository at this point in the history
  • Loading branch information
mdnoble73 committed May 7, 2024
1 parent bf4d888 commit 850b862
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
Binary file modified code/cron/cron.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public void doCronProcess(String servername, Ini configIni, Section processSetti
removeOldIndexingData(dbConn, logger, processLog);
removeOldExternalRequests(dbConn, logger, processLog);
optimizeSearchTable(dbConn, logger, processLog);
optimizeSessionsTable(dbConn, logger, processLog);

cleanupReadingHistory(dbConn, logger, processLog);

Expand All @@ -51,6 +52,20 @@ private void optimizeSearchTable(Connection dbConn, Logger logger, CronProcessLo
}
}

private void optimizeSessionsTable(Connection dbConn, Logger logger, CronProcessLogEntry processLog) {
//Optimize search table
try {
PreparedStatement optimizeStmt = dbConn.prepareStatement("OPTIMIZE TABLE session");

optimizeStmt.execute();

processLog.addNote("Optimized sessions table.");
processLog.saveResults();
} catch (SQLException e) {
processLog.incErrors("Unable to optimize search table. ", e);
}
}

private void cleanupReadingHistory(Connection dbConn, Logger logger, CronProcessLogEntry processLog) {
//Remove long searches
try {
Expand Down
1 change: 1 addition & 0 deletions code/web/release_notes/24.05.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
- Fix default colors for some elements within themes to be white. (Ticket 131505) (*MDN*)
- Error handling when viewing records that are not linked to a grouped work. (*MDN*)
- Correct license included in repository based on VuFind original license. (*MDN*)
- Optimize session table during nightly cron. (*MDN*)

## This release includes code contributions from
- ByWater Solutions
Expand Down

0 comments on commit 850b862

Please sign in to comment.