Add Gunicorn support for production in Vosk service and update requirements
This commit is contained in:
@@ -267,5 +267,11 @@ if __name__ == '__main__':
|
||||
app = create_async_app()
|
||||
web.run_app(app, host='0.0.0.0', port=5000)
|
||||
else:
|
||||
# Run Flask version
|
||||
app.run(host='0.0.0.0', port=5000, threaded=True, processes=4)
|
||||
# Run Flask version with proper multiprocessing setup
|
||||
# Use Gunicorn for production multiprocessing
|
||||
if os.getenv('USE_GUNICORN', 'false').lower() == 'true':
|
||||
# This will be handled by Gunicorn
|
||||
app.run(host='0.0.0.0', port=5000)
|
||||
else:
|
||||
# Use threading for development
|
||||
app.run(host='0.0.0.0', port=5000, threaded=True)
|
||||
Reference in New Issue
Block a user