Honor 429 Too Many Requests and 503 Service Unavailable responses

This commit is contained in:
Joakim Hellsén 2025-05-05 01:19:52 +02:00
commit 901d6cb1a6
No known key found for this signature in database
GPG key ID: D196AE66FEBE1DC9
3 changed files with 14 additions and 5 deletions

View file

@ -24,7 +24,7 @@ default_custom_embed: dict[str, str] = {
}
@lru_cache
@lru_cache(maxsize=1)
def get_reader(custom_location: Path | None = None) -> Reader:
"""Get the reader.
@ -35,5 +35,10 @@ def get_reader(custom_location: Path | None = None) -> Reader:
The reader.
"""
db_location: Path = custom_location or Path(data_dir) / "db.sqlite"
reader: Reader = make_reader(url=str(db_location))
return make_reader(url=str(db_location))
# https://reader.readthedocs.io/en/latest/api.html#reader.types.UpdateConfig
# Set the update interval to 15 minutes
reader.set_tag((), ".reader.update", {"interval": 15})
return reader