fix: initialization None error
All checks were successful
Build Worker Base and Application Images / check-base-changes (push) Successful in 8s
Build Worker Base and Application Images / build-base (push) Has been skipped
Build Worker Base and Application Images / build-docker (push) Successful in 2m53s
Build Worker Base and Application Images / deploy-stack (push) Successful in 9s
All checks were successful
Build Worker Base and Application Images / check-base-changes (push) Successful in 8s
Build Worker Base and Application Images / build-base (push) Has been skipped
Build Worker Base and Application Images / build-docker (push) Successful in 2m53s
Build Worker Base and Application Images / deploy-stack (push) Successful in 9s
This commit is contained in:
parent
2f3c2b08cb
commit
c2c80222f1
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