🚧 Initial work on retryable managers
This commit is contained in:
@@ -2,14 +2,15 @@ from requests import HTTPError
|
||||
|
||||
from src.game import Game
|
||||
from src.store.managers.async_manager import AsyncManager
|
||||
from src.utils.steamgriddb import SGDBAuthError, SGDBError, SGDBHelper
|
||||
from src.store.managers.steam_api_manager import SteamAPIManager
|
||||
from src.utils.steamgriddb import HTTPError, SGDBAuthError, SGDBError, SGDBHelper
|
||||
|
||||
|
||||
class SGDBManager(AsyncManager):
|
||||
"""Manager in charge of downloading a game's cover from steamgriddb"""
|
||||
|
||||
run_after = set((SteamAPIManager,))
|
||||
retryable_on = set((HTTPError,))
|
||||
|
||||
def final_run(self, game: Game) -> None:
|
||||
try:
|
||||
@@ -19,7 +20,3 @@ class SGDBManager(AsyncManager):
|
||||
# If invalid auth, cancel all SGDBManager tasks
|
||||
self.cancellable.cancel()
|
||||
self.report_error(error)
|
||||
except (HTTPError, SGDBError) as error:
|
||||
# On other error, just report it
|
||||
self.report_error(error)
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user