mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-12-06 06:36:25 +00:00
Delete timedout running requests
This commit is contained in:
@@ -47,7 +47,7 @@ class Provider(ABC):
|
|||||||
search = await self.search_movies(title, year, language=[])
|
search = await self.search_movies(title, year, language=[])
|
||||||
if not any(search):
|
if not any(search):
|
||||||
raise ProviderError(
|
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(
|
ret = await self.get_movie(
|
||||||
{k: v.data_id for k, v in search[0].external_id.items()}
|
{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=[])
|
search = await self.search_series(title, year, language=[])
|
||||||
if not any(search):
|
if not any(search):
|
||||||
raise ProviderError(
|
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(
|
ret = await self.get_serie(
|
||||||
{k: v.data_id for k, v in search[0].external_id.items()}
|
{k: v.data_id for k, v in search[0].external_id.items()}
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ class RequestCreator:
|
|||||||
"""
|
"""
|
||||||
delete from scanner.requests
|
delete from scanner.requests
|
||||||
where status = 'failed'
|
where status = 'failed'
|
||||||
|
or (status = 'running'
|
||||||
|
and now() - started_at > interval '1 hour')
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user