#!/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."