feat: add redis cache
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import datetime
|
||||
import logging
|
||||
|
||||
from aiocache import cached
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
from gallery.sketch.schedule.api import ScheduleApi
|
||||
@@ -13,8 +12,8 @@ logger = logging.getLogger("matchtv")
|
||||
|
||||
|
||||
class MatchTvApi(ScheduleApi):
|
||||
PROVIDER = "matchtv"
|
||||
SOURCE = ApiSource("https://matchtv.ru")
|
||||
CACHE_TTL = 30 * 60
|
||||
|
||||
async def get_channels(self) -> list[str]:
|
||||
return [
|
||||
@@ -27,7 +26,6 @@ class MatchTvApi(ScheduleApi):
|
||||
ChannelId.MATCH_STRANA,
|
||||
]
|
||||
|
||||
@cached(ttl=CACHE_TTL)
|
||||
async def get_channel_schedule(
|
||||
self, channel_id: str, date: datetime.date
|
||||
) -> Schedule:
|
||||
|
||||
Reference in New Issue
Block a user