Rescue DB errors in get_video()

This commit is contained in:
Samantaz Fox 2022-04-08 22:52:34 +02:00 committed by GitHub
parent 91b079f4df
commit 135aaf56fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -1094,6 +1094,10 @@ def get_video(id, refresh = true, region = nil, force_refresh = false)
end end
return video 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 end
def fetch_video(id, region) def fetch_video(id, region)