""" Redis constants. """ # Maximum number of items on track comparison page from apollo_utils.core.utils.ext_enum import ExtEnum COMPARED_TRACKS_LIMIT = 5 class CacheMode(ExtEnum): """Supported cache modes. REGULAR - regular usage: firstly try to find data in cache, if nothing was found, load new data and store it in cache. UPDATE - do not check cache, load new data and store it in cache. IGNORE - load new data and return it without saving to cache. """ REGULAR = "regular" UPDATE = "update" IGNORE = "ignore" @classmethod def has(cls, value): return value in cls._value2member_map_ DEFAULT_CACHE_MODE = CacheMode.REGULAR