Skip to content

Add 30-minute cache TTL for Sharesight MCP server - #23

Merged
robdevops merged 2 commits into
mainfrom
claude/sharesight-cache
Oct 7, 2026
Merged

robdevops merged 2 commits into
mainfrom
claude/sharesight-cache

Conversation

@robdevops

Copy link
Copy Markdown
Owner

Adds a 30-minute cache TTL to the Sharesight MCP server configuration to share portfolio results between concurrent users, reducing redundant API calls for frequently accessed portfolios.

Changes:

  • Added cache_ttl: 1800 (30 minutes) to the Sharesight server config in mcp_servers.json
  • Added test test_sharesight_results_are_cached_for_thirty_minutes to verify cache expiration behavior at the 30-minute boundary
  • Updated README to document the cache TTL values: 30 seconds for Yahoo, 30 minutes for Sharesight

Implementation details:

  • The test uses monkeypatching to control time.monotonic() and verifies that:
    • A second identical call within 30 minutes reuses the cached result (1 API call total)
    • A call after 30 minutes expires the cache and fetches fresh data (2 API calls total)
  • The cache TTL value (1800 seconds) is read from the config file in the test to ensure consistency

https://claude.ai/code/session_014k4kywyN5dAo39izUPvxbw

claude added 2 commits October 7, 2026 23:30
cache_ttl 600 on the sharesight server in mcp_servers.json (Yahoo stays at 30 seconds).
Identical calls within the window share one result, including the daily holding-news check.
Errors are never cached, and the cache lives in memory so a restart clears it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014k4kywyN5dAo39izUPvxbw
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014k4kywyN5dAo39izUPvxbw
@robdevops
robdevops enabled auto-merge October 7, 2026 23:31
@robdevops
robdevops merged commit af6301a into main Oct 7, 2026
1 check passed
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