Skip to content

Improve CachedFetcher #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 24, 2025
Merged

Conversation

thewhaleking
Copy link
Collaborator

@thewhaleking thewhaleking commented Jun 24, 2025

  • Makes CachedFetcher compatible with a wrapper
  • Allow CachedFetcher to handle methods with multiple args.
  • Adds a wrapper for using CachedFetcher as you would any other cache (i.e. @functools.cached
  • Replaces asyncstdlib.lru_cache with CachedFetcher in DiskCachedAsyncSubstrate
  • Removes asyncstdlib as a dependency
  • Fixes tests
  • Replaces cache.py's print calls with logging.
  • Adds new method get_runtime_for_version which is basically the internals for fetching/creating a Runtime object from init_runtime, but which can be cached by runtime version specified.

@thewhaleking thewhaleking requested a review from a team June 24, 2025 18:19
@github-actions github-actions bot added run-bittensor-sdk-tests Runs Bittensor SDK tests. run-bittensor-cli-tests Runs BTCLI tests. labels Jun 24, 2025
@thewhaleking thewhaleking merged commit 2d4b558 into staging Jun 24, 2025
65 of 66 checks passed
@thewhaleking thewhaleking deleted the feat/thewhaleking/enhance-caching branch June 24, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-bittensor-cli-tests Runs BTCLI tests. run-bittensor-sdk-tests Runs Bittensor SDK tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants