Skip to content

Refactor EngineSessionCache - #505

Merged
qligier merged 2 commits into
mainfrom
feat/refactor-engine-cache
Aug 3, 2026
Merged

Refactor EngineSessionCache#505
qligier merged 2 commits into
mainfrom
feat/refactor-engine-cache

Conversation

@qligier

@qligier qligier commented Apr 2, 2026

Copy link
Copy Markdown
Member

For clarity/better maintainability.

@qligier
qligier requested a review from Copilot April 2, 2026 14:50
@qligier qligier self-assigned this Apr 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors how MatchboxEngineSupport caches MatchboxEngine instances by replacing the previous EngineSessionCache implementation with a new MatchboxEngineCache bean, aiming to make caching clearer and easier to maintain.

Changes:

  • Replaced EngineSessionCache usage with a new MatchboxEngineCache (permanent + expiring transient engines).
  • Updated engine cache keying/logging to use CliContext.sessionId() (currently derived from hashCode()).
  • Wired the new cache into Spring config via a dedicated @Bean and removed the old cache class.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
matchbox-server/src/main/java/ch/ahdis/matchbox/util/MatchboxEngineSupport.java Switches engine caching lookups/stores to MatchboxEngineCache and updates logging/session-id handling.
matchbox-server/src/main/java/ch/ahdis/matchbox/util/MatchboxEngineCache.java Introduces new cache abstraction for permanent and 60-minute transient engines.
matchbox-server/src/main/java/ch/ahdis/matchbox/util/EngineSessionCache.java Removes the legacy session cache implementation.
matchbox-server/src/main/java/ch/ahdis/matchbox/config/MatchboxJpaConfig.java Registers MatchboxEngineCache as a Spring bean and injects it into MatchboxEngineSupport.
matchbox-server/src/main/java/ch/ahdis/matchbox/CliContext.java Adds sessionId() helper used for cache keys and logging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread matchbox-server/src/main/java/ch/ahdis/matchbox/util/MatchboxEngineCache.java Outdated
@qligier
qligier force-pushed the feat/refactor-engine-cache branch from 740b5a4 to a2f11d2 Compare June 22, 2026 19:31
@qligier
qligier force-pushed the feat/refactor-engine-cache branch from a2f11d2 to 8ec0991 Compare August 3, 2026 12:15
@qligier
qligier merged commit df3a079 into main Aug 3, 2026
9 checks passed
@qligier
qligier deleted the feat/refactor-engine-cache branch August 3, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants