Add Gunicorn support for production in Vosk service and update requirements

This commit is contained in:
Alireza
2025-08-02 17:52:11 +03:30
parent 0d151529f0
commit cfe2b2346a
7 changed files with 220 additions and 6 deletions

36
vosk/test_files/quick_fix.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
# Quick fix for Flask multiprocessing issue
echo "🔧 Applying quick fix for Flask multiprocessing issue..."
# Kill any existing Vosk service
echo "🛑 Stopping any existing Vosk service..."
pkill -f "python.*app_optimized" || true
pkill -f "gunicorn.*app_optimized" || true
# Wait a moment
sleep 2
# Start the service with proper configuration
echo "🚀 Starting Vosk service with proper configuration..."
cd ../vosk_service
# Use the startup script that handles configuration properly
python start_service.py &
VOSK_PID=$!
echo "✅ Vosk service started with PID: $VOSK_PID"
# Wait for service to be ready
echo "⏳ Waiting for service to be ready..."
for i in {1..30}; do
if curl -s http://localhost:5000/ > /dev/null; then
echo "✅ Service is ready!"
break
fi
sleep 1
done
echo "🎯 Service should now be running without the multiprocessing error!"
echo "💡 You can now run your optimized processing script."