Merge branch 'kortix-ai:main' into cleanup-main

This commit is contained in:
Bobbie 2025-07-09 23:31:25 +05:30 committed by GitHub
commit 012d08e1cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 17 deletions

View File

@ -66,14 +66,14 @@ jobs:
docker compose build
docker compose up -d
# - name: Deploy to prod
# if: steps.get_tag_name.outputs.environment == 'prod'
# uses: appleboy/ssh-action@v1
# with:
# host: ${{ secrets.PROD_HOST }}
# username: ${{ secrets.PROD_USERNAME }}
# key: ${{ secrets.PROD_KEY }}
# script: |
# cd /mnt/gluster-shared/data/infra/suna
# set -a; source .env; set +a
# docker stack deploy -c docker-compose.yml suna
- name: Deploy to prod
if: steps.get_tag_name.outputs.environment == 'prod'
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.PROD_HOST }}
username: ${{ secrets.PROD_USERNAME }}
key: ${{ secrets.PROD_KEY }}
script: |
cd /mnt/gluster-shared/data/infra/suna
set -a; source .env; set +a
docker stack deploy -c docker-compose.yml suna

View File

@ -19,7 +19,6 @@ import json
from resumable_stream.runtime import create_resumable_stream_context, ResumableStreamContext
_initialized = False
db = DBConnection()
instance_id = "single"
@ -36,12 +35,11 @@ async def get_stream_context():
async def initialize():
"""Initialize the agent API with resources from the main API."""
global db, instance_id, _initialized
global instance_id, _initialized
if not instance_id:
instance_id = str(uuid.uuid4())[:8]
await retry(lambda: redis.initialize_async())
await db.initialize()
_initialized = True
logger.info(f"Initialized agent API with instance ID: {instance_id}")
@ -78,6 +76,8 @@ async def run_agent_run_stream(
try:
await initialize()
db = DBConnection()
await db.initialize()
except Exception as e:
logger.critical(f"Failed to initialize: {e}")
raise e

View File

@ -29,7 +29,7 @@ def initialize():
redis_password = os.getenv("REDIS_PASSWORD", "")
# Connection pool configuration
max_connections = int(os.getenv("REDIS_MAX_CONNECTIONS", 1024))
max_connections = int(os.getenv("REDIS_MAX_CONNECTIONS", 2048))
retry_on_timeout = not (os.getenv("REDIS_RETRY_ON_TIMEOUT", "True").lower() != "true")
logger.info(f"Initializing Redis connection pool to {redis_host}:{redis_port} with max {max_connections} connections")
@ -40,8 +40,8 @@ def initialize():
port=redis_port,
password=redis_password,
decode_responses=True,
socket_timeout=5.0,
socket_connect_timeout=5.0,
socket_timeout=20.0,
socket_connect_timeout=20.0,
retry_on_timeout=retry_on_timeout,
health_check_interval=30,
max_connections=max_connections,