Delete timedout running requests

This commit is contained in:
2025-12-04 17:51:03 +01:00
parent 4f2b2d2cd2
commit a1b975cc5d
2 changed files with 4 additions and 2 deletions

View File

@@ -47,7 +47,7 @@ class Provider(ABC):
search = await self.search_movies(title, year, language=[])
if not any(search):
raise ProviderError(
f"Couldn't find a movie with title {title}. (year: {year}"
f"Couldn't find a movie with title {title}. (year: {year})"
)
ret = await self.get_movie(
{k: v.data_id for k, v in search[0].external_id.items()}
@@ -68,7 +68,7 @@ class Provider(ABC):
search = await self.search_series(title, year, language=[])
if not any(search):
raise ProviderError(
f"Couldn't find a serie with title {title}. (year: {year}"
f"Couldn't find a serie with title {title}. (year: {year})"
)
ret = await self.get_serie(
{k: v.data_id for k, v in search[0].external_id.items()}

View File

@@ -41,6 +41,8 @@ class RequestCreator:
"""
delete from scanner.requests
where status = 'failed'
or (status = 'running'
and now() - started_at > interval '1 hour')
"""
)