def _get_ie_status_from_cache(self): """Get export job status from memcache if exists, from DB otherwise.""" if not self.ie_job: return None cache_key = cache_utils.get_ie_cache_key(self.ie_job) ie_status = self.cache_manager.cache_object.memcache_client.get(cache_key) return ie_status
def expire_ie_cache(ie_job): """Expire export status cache to force DB request.""" cache_manager = cache_utils.get_cache_manager() cache_key = cache_utils.get_ie_cache_key(ie_job) cache_manager.cache_object.memcache_client.delete(cache_key)
def _add_ie_status_to_cache(self, status): """Add export job status to memcache""" cache_key = cache_utils.get_ie_cache_key(self.ie_job) self.cache_manager.cache_object.memcache_client.add(cache_key, status)