8000 Add lru_cache_timed decorator by taldcroft · Pull Request #20 · sot/ska_helpers · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add lru_cache_timed decorator #20

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 1 commit into from
Dec 18, 2020
Merged

Add lru_cache_timed decorator #20

merged 1 commit into from
Dec 18, 2020

Conversation

taldcroft
Copy link
Member

Description

This adds an LRU cache decorator where the cache expires after timeout seconds.

The inspiration is an issue with the cheta archive where the code below was stopping a persistent session from seeing new updates in the data.

@memoized
def get_interval(content, tstart, tstop):
    ...

An alternative is to install the entire cachetools package, which is available as a conda package in pkgs/main.

Testing

  • Passes unit tests on MacOS
  • Functional testing (new unit test)

@taldcroft taldcroft mentioned this pull request Dec 17, 2020
2 tasks
@taldcroft taldcroft merged commit a8f24e7 into master Dec 18, 2020
@taldcroft taldcroft deleted the lru-cache-timed branch December 18, 2020 16:51
@javierggt javierggt mentioned this pull request Mar 2, 2021
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
0