fix: initialization None error #13
1 changed files with 7 additions and 3 deletions
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue