Skip to content

Commit

Permalink
Allow turning of cache for get_lineup_fields
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Oct 13, 2024
1 parent 4896c13 commit 7cc105a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions genshin/client/components/lineup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ async def request_lineup(

return await self.request(url, method=method, params=params, **kwargs)

async def get_lineup_fields(self, *, lang: typing.Optional[str] = None) -> models.LineupFields:
async def get_lineup_fields(
self, *, lang: typing.Optional[str] = None, use_cache: bool = True
) -> models.LineupFields:
"""Get configuration lineup fields."""
data = await self.request_lineup(
"config",
lang=lang,
static_cache=cache.cache_key("lineup", endpoint="config", lang=lang or self.lang),
static_cache=cache.cache_key("lineup", endpoint="config", lang=lang or self.lang) if use_cache else None,
)

return models.LineupFields(**data)
Expand Down

0 comments on commit 7cc105a

Please sign in to comment.