Skip to content
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

Update http cache rules to be more effective #1870

Merged
merged 6 commits into from
Jan 16, 2025
Merged

Conversation

glensc
Copy link
Collaborator

@glensc glensc commented Mar 17, 2024

Such overrides actually work now:

  policy:
    "api.trakt.tv/users/me": 12d
    # Trakt search urls, 304 works
    "api.trakt.tv/search/imdb/tt*?type=movie": "7d"
    "api.trakt.tv/search/imdb/tt*?type=show": "7d"
    "api.trakt.tv/search/tmdb/*?type=movie": "7d"
    "api.trakt.tv/search/tmdb/*?type=show": "7d"
    "api.trakt.tv/search/tvdb/*?type=show": "7d"
    "api.trakt.tv/shows/*/seasons?extended=episodes": "2d"

Might even work like offline mode now.

@glensc glensc self-assigned this Mar 17, 2024
@glensc glensc marked this pull request as draft March 17, 2024 18:01
@glensc
Copy link
Collaborator Author

glensc commented Mar 17, 2024

weird errors have appeared with cold cache

WARNING  Connection pool is full, discarding connection: 192-168-x-y.[redacted].plex.direct. Connection pool size: 10  
WARNING  Connection pool is full, discarding connection: 192-168-x-y.[redacted].plex.direct. Connection pool size: 10  
WARNING  Connection pool is full, discarding connection: 192-168-x-y.[redacted].plex.direct. Connection pool size: 10

comes from urllib3

site-packages/pip/_vendor/urllib3/connectionpool.py:                "Connection pool is full, discarding connection: %s. Connection pool size: %s",

EDIT: Asked question about it in requests-cache:

@glensc
Copy link
Collaborator Author

glensc commented Nov 8, 2024

Heavy caching may result duplicate marking as watched, i.e plex state is cached, and now another Marking as watched would make duplicate watch.

Should re-fetch item before making actual changes.

@glensc
Copy link
Collaborator Author

glensc commented Jan 1, 2025

Stale if error moved a to separate pr:

@glensc glensc marked this pull request as ready for review January 1, 2025 16:38
@glensc
Copy link
Collaborator Author

glensc commented Jan 16, 2025

It seems to be working locally for a while.

Also, as trakt reduced api calls per 5 minute limit, it might become useful to tune caching:

@glensc glensc merged commit 8053a81 into Taxel:main Jan 16, 2025
4 checks passed
@glensc glensc deleted the http-cache branch January 16, 2025 13:57
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