You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is more a user question then an issue.
But I was looking for a way to cache a result, if that result is for example None.
@recommended_series_cache.cache_on_arguments()
def cached_get_imdb_series_genres(imdb_id):
"""
Request the series genres from the api.
Use dogpile cache to return a cached id if available.
"""
genres = api.get_title_genres(imdb_id)
if not genres:
raise Exception(f'Could not get imdb genres from {imdb_id}')
return genres
Would this prevent it from being dogpile cached?
The text was updated successfully, but these errors were encountered:
caching can be prevented if you raise an exception but that would raise an exception overall. what do you want the return value of cached_get_imdb_series_genres() to be when you can't get the genres? if you want it to just raise, then you can raise, there's nothing it can cache in that case.
This is more a user question then an issue.
But I was looking for a way to cache a result, if that result is for example None.
Would this prevent it from being dogpile cached?
The text was updated successfully, but these errors were encountered: