From c2c80222f14efa9610bfa8877427e7a29d2cd90b Mon Sep 17 00:00:00 2001 From: ziesorx Date: Thu, 25 Sep 2025 03:21:22 +0700 Subject: [PATCH] fix: initialization None error --- core/streaming/manager.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/streaming/manager.py b/core/streaming/manager.py index 6cf120f..0856635 100644 --- a/core/streaming/manager.py +++ b/core/streaming/manager.py @@ -458,11 +458,15 @@ class StreamManager: # Global shared instance for application use -# Will be initialized with config value in app.py -shared_stream_manager = None +# Default initialization, will be updated with config value in app.py +shared_stream_manager = StreamManager(max_streams=20) def initialize_stream_manager(max_streams: int = 10): - """Initialize the global stream manager with config value.""" + """Re-initialize the global stream manager with config value.""" global shared_stream_manager + # Release old manager if exists + if shared_stream_manager: + # Stop all existing streams gracefully + shared_stream_manager.cleanup() shared_stream_manager = StreamManager(max_streams=max_streams) return shared_stream_manager \ No newline at end of file