mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-04-06 17:21:58 -04:00
Properly handle requests timeout
This commit is contained in:
parent
c842a05443
commit
6977ffd5d6
@ -56,8 +56,6 @@ class RequestCreator:
|
||||
"""
|
||||
delete from scanner.requests
|
||||
where status = 'failed'
|
||||
or (status = 'running'
|
||||
and now() - started_at > interval '1 hour')
|
||||
"""
|
||||
)
|
||||
|
||||
@ -136,6 +134,10 @@ class RequestProcessor:
|
||||
scanner.requests
|
||||
where
|
||||
status = 'pending'
|
||||
or (
|
||||
status = 'running'
|
||||
and now() - started_at > interval '30 minutes'
|
||||
)
|
||||
limit 1
|
||||
for update
|
||||
skip locked)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user