Spaces:
Running

File size: 1,243 Bytes
bbf53ef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

import asyncio
import sys
import os

# Add project root to sys.path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))

# Mock settings before importing app
os.environ["DATABASE_URL"] = "postgresql://user:pass@localhost/db"
os.environ["SUPABASE_URL"] = "https://test.supabase.co"
os.environ["SUPABASE_KEY"] = "test"
os.environ["SECRET_KEY"] = "test_secret_key_long_enough_32_chars_"
os.environ["GROQ_API_KEY"] = "test" * 20

from app.services.ai_queue import get_ai_queue
from app.services.voice_service import voice_service

async def test_limits():
    print("--- SCALING CONFIGURATION VERIFICATION ---")
    
    # 1. Check AI Queue
    queue = get_ai_queue()
    print(f"AI Queue Max RPM: {queue.max_rpm}")
    print(f"AI Queue Max Concurrent: {queue.max_concurrent}")
    
    # 2. Check Voice Semaphore
    print(f"Voice Semaphore Limit: {voice_service.semaphore._value}")
    
    # 3. Check DB config from database.py manually since we can't easily check pool size without engine
    from app.core.database import async_engine
    print(f"DB Pool Size Config: {async_engine.pool.size()}")
    
    print("\n✅ Scaling configurations verified.")

if __name__ == "__main__":
    asyncio.run(test_limits())