Clear failed requests before scanning

This commit is contained in:
Zoe Roux 2025-05-18 23:27:58 +02:00
parent c9fcbc8e8f
commit ae0f55ae9b
No known key found for this signature in database
2 changed files with 10 additions and 0 deletions

View File

@ -41,6 +41,8 @@ class FsScanner:
logger.info("Starting scan at %s. This may take some time...", path)
if self._ignore_pattern:
logger.info(f"Applying ignore pattern: {self._ignore_pattern}")
await self._requests.clear_failed()
try:
videos = self.walk_fs(path)

View File

@ -48,6 +48,14 @@ class RequestCreator:
)
_ = await self._database.execute("notify scanner_requests")
async def clear_failed(self):
_ = await self._database.execute(
"""
delete from scanner.requests
where status = 'failed'
"""
)
class RequestProcessor:
def __init__(