mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
Rescue DB errors in get_video()
This commit is contained in:
parent
91b079f4df
commit
135aaf56fd
1 changed files with 4 additions and 0 deletions
|
@ -1094,6 +1094,10 @@ def get_video(id, refresh = true, region = nil, force_refresh = false)
|
|||
end
|
||||
|
||||
return video
|
||||
rescue DB::Error
|
||||
# Avoid common `DB::PoolRetryAttemptsExceeded` error and friends
|
||||
# Note: All DB errors inherit from `DB::Error`
|
||||
return fetch_video(id, region)
|
||||
end
|
||||
|
||||
def fetch_video(id, region)
|
||||
|
|
Loading…
Reference in a new issue