🎨 SourceIterator can yield addtitional data

SourceIterator-s can yield a game and a tuple of additional data.
This data will be passed to the Store, Pipeline and Managers.
This commit is contained in:
GeoffreyCoulaud
2023-06-07 14:01:06 +02:00
parent 7eef050a64
commit 98f02da36c
12 changed files with 68 additions and 37 deletions

View File

@@ -1,3 +1,5 @@
from urllib3.exceptions import SSLError
from src.game import Game
from src.store.managers.async_manager import AsyncManager
from src.store.managers.steam_api_manager import SteamAPIManager
@@ -8,9 +10,9 @@ class SGDBManager(AsyncManager):
"""Manager in charge of downloading a game's cover from steamgriddb"""
run_after = set((SteamAPIManager,))
retryable_on = set((HTTPError,))
retryable_on = set((HTTPError, SSLError))
def manager_logic(self, game: Game) -> None:
def manager_logic(self, game: Game, _additional_data: tuple) -> None:
try:
sgdb = SGDBHelper()
sgdb.conditionaly_update_cover(game)