Skip to content

Refactor EngineSessionCache#505

Open
qligier wants to merge 2 commits into
mainfrom
feat/refactor-engine-cache
Open

Refactor EngineSessionCache#505
qligier wants to merge 2 commits into
mainfrom
feat/refactor-engine-cache

Conversation

@qligier
Copy link
Copy Markdown
Member

@qligier qligier commented Apr 2, 2026

For clarity/better maintainability.

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

Copilot AI left a comment

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
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