How to use the fitter.cachestore.redis.RedisStore function in fitter

To help you get started, we’ve selected a few fitter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mingrammer / fitter / fitter / __init__.py View on Github external
storage_config['AWS_SECRET_ACCESS_KEY'],
        storage_config['BUCKET_NAME'],
        storage_config['BUCKET_REGION'],
        storage_config['LOCATION'],
    )


fitter = Flask('fitter')
fitter.config.from_object(FitterConfig())

fitter.cache_store = None
fitter.source_storage = None
fitter.store_storage = None

if fitter.config['CACHE_STORE']['TYPE'] == 'redis':
    fitter.cache_store = RedisStore(
        fitter.config['CACHE_STORE']['HOST'],
        fitter.config['CACHE_STORE']['PORT'],
        fitter.config['CACHE_STORE']['DB'],
        fitter.config['CACHE_STORE']['PASSWORD'],
    )
elif fitter.config['CACHE_STORE']['TYPE'] == 'in-memory':
    fitter.cache_store = InMemoryStore()

_source_storage_config = fitter.config['SOURCE_STORAGE']
_store_storage_config = fitter.config['STORE_STORAGE']

if _source_storage_config['TYPE'] == 'fs':
    fitter.source_storage = _set_file_system_storage(FileSystemSourceStorage, _source_storage_config)
elif _source_storage_config['TYPE'] == 's3':
    fitter.source_storage = _set_s3_storage(S3SourceStorage, _source_storage_config)