mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
fix(cert): assignment to entry in nil map
This commit is contained in:
parent
0162e10c53
commit
710b9f781e
1 changed files with 2 additions and 6 deletions
|
@ -10,10 +10,10 @@ var (
|
|||
mutex sync.Mutex
|
||||
|
||||
// statusChan is the channel to broadcast certificate status changes
|
||||
statusChan chan bool
|
||||
statusChan = make(chan bool, 10)
|
||||
|
||||
// subscribers is a map of channels that are subscribed to certificate status changes
|
||||
subscribers map[chan bool]struct{}
|
||||
subscribers = make(map[chan bool]struct{})
|
||||
|
||||
// subscriberMux protects the subscribers map from concurrent access
|
||||
subscriberMux sync.RWMutex
|
||||
|
@ -26,10 +26,6 @@ var (
|
|||
)
|
||||
|
||||
func initBroadcastStatus(ctx context.Context) {
|
||||
// Initialize channels and maps
|
||||
statusChan = make(chan bool, 10) // Buffer to prevent blocking
|
||||
subscribers = make(map[chan bool]struct{})
|
||||
|
||||
// Start broadcasting goroutine
|
||||
go broadcastStatus(ctx)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue