Repository navigation
Conversation
cache_add() looks up an existing entry with cache_fetch_by_url(), which also downloads the file (toniebox-reverse-engineering#527). With tonie_json.cache_images on, every load of tonies.json (start, /api/toniesJsonReload) therefore downloads all pictures one by one, and the reload request hangs for many minutes. Look the entry up without fetching it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #527 (e57fa45),
cache_add()looks up an existing entry withcache_fetch_by_url(), which also downloads thepicture when it is not cached yet. With
tonie_json.cache_imageson, loading tonies.json thus downloads pictures oneafter the other even with
tonie_json.cache_preloadoff, and/api/toniesJsonReloadhangs for minutes with a freshcache.
The lookup now uses a separate
cache_find_by_url()without the download;cache_fetch_by_url()keeps its behaviourand uses it. The duplicate-entry leak fixed by #527 stays fixed.
Tested:
make build,make test_py TESTS=cache,make test_py TESTS=Cache499.Fixes #570