mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
subscribe to container changes in Caddyfile controller
This commit is contained in:
@@ -120,7 +120,14 @@ func (s *Store) SubscribeMachines(ctx context.Context) ([]*pb.MachineInfo, <-cha
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case <-events:
|
||||
case _, ok := <-events:
|
||||
if !ok {
|
||||
// events channel has been closed.
|
||||
if sub.Err() != nil {
|
||||
slog.Error("Machines subscription failed.", "id", sub.ID(), "err", sub.Err())
|
||||
}
|
||||
return
|
||||
}
|
||||
// Just signal that there is a change in the machines list.
|
||||
changes <- struct{}{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user