mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-01-07 04:30:27 -05:00
Delete timedout running requests
This commit is contained in:
parent
4f2b2d2cd2
commit
a1b975cc5d
@ -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()}
|
||||
|
||||
@ -41,6 +41,8 @@ class RequestCreator:
|
||||
"""
|
||||
delete from scanner.requests
|
||||
where status = 'failed'
|
||||
or (status = 'running'
|
||||
and now() - started_at > interval '1 hour')
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user