def get_cache(cls, id): key = '{}_{}'.format(cls.__name__, id) cached = mc_client.get(key) if cached is not None: return pickle.loads(cached)
def from_cache_for_boat(cls, boat): key = '{}_{}'.format(cls.__name__, boat.id) cached = mc_client.get(key) if cached is not None: return pickle.loads(cached)
def from_cache_by_mmsi(cls, mmsi): key = '{}_{}'.format(cls.__name__, mmsi) cached = mc_client.get(key) if cached is not None: return pickle.loads(cached)