https://github.com/thumbor-community/redis
Redis support
https://github.com/thumbor-community/redis
Last synced: 2 months ago
JSON representation
Redis support
- Host: GitHub
- URL: https://github.com/thumbor-community/redis
- Owner: thumbor-community
- License: mit
- Created: 2015-08-11T14:17:21.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-01-02T19:36:03.000Z (over 1 year ago)
- Last Synced: 2024-10-14T08:53:40.925Z (8 months ago)
- Language: Python
- Homepage:
- Size: 122 KB
- Stars: 12
- Watchers: 5
- Forks: 16
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-thumbor - GitHub - 33% open</span> · <span title="Last update timestamp on package manager" alt="Last update timestamp on package manager">⏱️ 02.01.2024</span>): (Image Storage & Result Storage)
README
# Redis storage adapters
Thumbor redis storage adapters.
## Installation
```bash
pip install tc_redis
```## Configuration
To use redis as a storage or result storage some values must be configured in `thumbor.conf`
##### Redis Storage
###### Single Node
```python
STORAGE = "tc_redis.storages.redis_storage"REDIS_STORAGE_IGNORE_ERRORS = True
REDIS_STORAGE_SERVER_PORT = 6379
REDIS_STORAGE_SERVER_HOST = "localhost"
REDIS_STORAGE_SERVER_DB = 0
REDIS_STORAGE_SERVER_PASSWORD = None
REDIS_STORAGE_MODE = "single_node"
```###### Cluster
```python
STORAGE = "tc_redis.storages.redis_storage"REDIS_STORAGE_IGNORE_ERRORS = True
REDIS_CLUSTER_STORAGE_STARTUP_INSTANCES = "localhost:6379,localhost:6380"
REDIS_STORAGE_SERVER_PASSWORD = None
REDIS_STORAGE_MODE = "cluster"
```###### Sentinel
```python
STORAGE = "tc_redis.storages.redis_storage"REDIS_STORAGE_IGNORE_ERRORS = True
REDIS_SENTINEL_STORAGE_INSTANCES = "localhost:26379,localhost:26380"
REDIS_SENTINEL_STORAGE_MASTER_INSTANCE = "redismaster"
REDIS_SENTINEL_STORAGE_MASTER_PASSWORD = "dummy"
REDIS_SENTINEL_STORAGE_PASSWORD = "dummy"
REDIS_SENTINEL_STORAGE_SOCKET_TIMEOUT = 1.0
REDIS_STORAGE_MODE = "sentinel"
```##### Redis Result Storage
###### Single Node
```python
RESULT_STORAGE = "tc_redis.result_storages.redis_result_storage"REDIS_RESULT_STORAGE_IGNORE_ERRORS = True
REDIS_RESULT_STORAGE_SERVER_PORT = 6379
REDIS_RESULT_STORAGE_SERVER_HOST = "localhost"
REDIS_RESULT_STORAGE_SERVER_DB = 0
REDIS_RESULT_STORAGE_SERVER_PASSWORD = None
REDIS_RESULT_STORAGE_MODE = "single_node"
```###### Cluster
```python
RESULT_STORAGE = "tc_redis.result_storages.redis_result_storage"REDIS_RESULT_STORAGE_IGNORE_ERRORS = True
REDIS_CLUSTER_RESULT_STORAGE_STARTUP_INSTANCES = "localhost:6379,localhost:6380"
REDIS_STORAGE_SERVER_PASSWORD = None
REDIS_RESULT_STORAGE_MODE = "cluster"
```###### Sentinel
```python
RESULT_STORAGE = "tc_redis.result_storages.redis_result_storage"REDIS_RESULT_STORAGE_IGNORE_ERRORS = True
REDIS_SENTINEL_RESULT_STORAGE_INSTANCES = "localhost:26379,localhost:26380"
REDIS_SENTINEL_RESULT_STORAGE_MASTER_INSTANCE = "redismaster"
REDIS_SENTINEL_RESULT_STORAGE_MASTER_PASSWORD = "dummy"
REDIS_SENTINEL_RESULT_STORAGE_PASSWORD = "dummy"
REDIS_SENTINEL_RESULT_STORAGE_SOCKET_TIMEOUT = 1.0
REDIS_RESULT_STORAGE_MODE = "sentinel"
```
## ContributeTo build tc_redis locally use
```bash
make setup
```To run unit tests use
```bash
make test
```