Skip to content

minor model updates and configuration change since timeout was added#6

Open
swelborn wants to merge 6 commits into
create-ports-locallyfrom
model-updates
Open

minor model updates and configuration change since timeout was added#6
swelborn wants to merge 6 commits into
create-ports-locallyfrom
model-updates

Conversation

@swelborn

@swelborn swelborn commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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

This PR updates the fastcache API’s data model and configuration serialization to align with upstream changes (timeout support) and naming used in related lclstream APIs.

Changes:

  • Renames cache lifecycle enum/fields from CacheStatus/status to CacheState/state across DB model, API schemas, and routes.
  • Simplifies cache-process config writing by removing FastcacheConfig and emitting the on-disk JSON via CacheConfig.to_fastcache_json().
  • Removes num_workers from the persisted/requested cache config and adds a default timeout.

Reviewed changes

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

Show a summary per file
File Description
src/fastcache_api/tables.py Renames the cache lifecycle column/attribute to state and updates enum usage.
src/fastcache_api/routes/cache.py Updates create/shutdown flows to use CacheState/state and adjusts active-cache filtering.
src/fastcache_api/reconcile.py Updates liveness reconciliation logic to use CacheState/state.
src/fastcache_api/process.py Switches config file generation to CacheConfig.to_fastcache_json() and uses URL parsing for port extraction.
src/fastcache_api/models.py Introduces CacheState, updates public schema field name to state, and changes config model/serialization (AnyUrl + timeout + JSON rendering).

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

Comment on lines +49 to 52
state: Mapped[str] = mapped_column(
default=CacheState.new,
doc="Lifecycle state; stored as the CacheState string value",
)
Comment on lines 24 to +27
Mirrors the cacheserver config (see config/default.json) plus the
resolved ZMQ bind URIs.
resolved ZMQ bind URIs. ``to_fastcache_json`` renders the on-disk config
the fastcache binary consumes (see src/config.cpp): the ZMQ URIs are
renamed to ``inurl``/``outurl`` and ``hostname`` is dropped.
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