Skip to content

refactor: set senior stock cache ttl from settings#8

Merged
br-monteiro merged 2 commits into
mainfrom
refactor/set-senior-stock-cache-ttl-from-settings
Mar 17, 2026
Merged

refactor: set senior stock cache ttl from settings#8
br-monteiro merged 2 commits into
mainfrom
refactor/set-senior-stock-cache-ttl-from-settings

Conversation

@br-monteiro

Copy link
Copy Markdown
Member

This pull request introduces configurable cache TTL (time-to-live) settings for authentication tokens and stock data in the Senior Stock API integration. It allows users to adjust how long authentication tokens and stock data are cached, either through configuration files or environment variables, and updates the documentation accordingly.

Configuration and documentation updates:

  • Added cache_token_ttl_seconds and cache_data_ttl_seconds as optional settings in the configuration example in README.md, and documented their purpose and default values. [1] [2]
  • Updated the environment variable section in README.md to include ONECLI_CACHE_TOKEN_TTL_SECONDS and ONECLI_CACHE_DATA_TTL_SECONDS.

Implementation of configurable cache TTLs:

  • Updated the SeniorStockAPI class in senior_stock_api.py to read cache_token_ttl_seconds and cache_data_ttl_seconds from settings, falling back to default constants if not provided.
  • Modified token and data caching logic to use the configurable TTL values instead of hardcoded constants. [1] [2]

@br-monteiro br-monteiro self-assigned this Mar 17, 2026
@br-monteiro br-monteiro merged commit 982a611 into main Mar 17, 2026
1 check passed
@br-monteiro br-monteiro deleted the refactor/set-senior-stock-cache-ttl-from-settings branch March 17, 2026 16:43
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.

1 participant