def cache_queries(self) -> bool: return self.env.read(BoolVar('CACHE_QUERIES', False))
def use_geocoding(self) -> bool: return self.env.read(BoolVar('USE_GEOCODING', False))
def cache_geocoding(self) -> bool: return self.env.read(BoolVar('CACHE_GEOCODING', False))
def use_geocoding(self) -> bool: return self.env.read(BoolVar(USE_GEOCODING_ENV_VAR, False))
def cache_queries(self) -> bool: return self.env.read(BoolVar(CACHE_QUERIES_ENV_VAR, False))
def use_flask() -> bool: env_var = BoolVar('USE_FLASK', False) return EnvReader().safe_read(env_var)
def keep_raw_entity(self) -> bool: var = BoolVar(KEEP_RAW_ENTITY_VAR, False) return self.store.safe_read(var)
from cache.factory import CacheEnvReader from utils.cfgreader import EnvReader, BoolVar, IntVar, StrVar def redis_connection() -> Redis: """ :return: A pooled connection to the configured QuantumLeap Redis cache. """ reader = CacheEnvReader() host = reader.redis_host() or 'localhost' port = reader.redis_port() return Redis(host=host, port=port) OFFLOAD_WORK_VAR = BoolVar('WQ_OFFLOAD_WORK', False) def offload_to_work_queue() -> bool: """ Offload task execution to the work queue? :return: `True` to offload tasks to the work queue; `False` to execute them synchronously within the calling thread. """ return EnvReader().safe_read(OFFLOAD_WORK_VAR) RECOVER_FROM_ENQUEUEING_FAILURE_VAR = \ BoolVar('WQ_RECOVER_FROM_ENQUEUEING_FAILURE', False)