Spaces:
Configuration error
Configuration error
Create config.py
Browse files
config.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from async_framework import BrokerConfig, RedisConfig, RetryConfig
|
| 2 |
+
|
| 3 |
+
# Redis configuration for multiple queues
|
| 4 |
+
BROKER_CONFIG = BrokerConfig(
|
| 5 |
+
redis=RedisConfig(
|
| 6 |
+
host="localhost",
|
| 7 |
+
port=6036,
|
| 8 |
+
password="***************",
|
| 9 |
+
db=0,
|
| 10 |
+
connection_pool_size=10,
|
| 11 |
+
#ssl=True # Enable SSL for Redis Cloud connection
|
| 12 |
+
),
|
| 13 |
+
retry=RetryConfig(
|
| 14 |
+
max_retries=3,
|
| 15 |
+
initial_delay=30.0,
|
| 16 |
+
max_delay=90.0,
|
| 17 |
+
backoff_factor=3.0
|
| 18 |
+
),
|
| 19 |
+
num_workers=2,
|
| 20 |
+
batch_size=5,
|
| 21 |
+
polling_interval=1.0,
|
| 22 |
+
metrics_port=8000 # Make sure this port is available
|
| 23 |
+
)
|