mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-06 13:18:58 +00:00
subscribe to container changes in Caddyfile controller
This commit is contained in:
1 parent
2134f3c1d9
commit
6b80ef9db8
5 files changed
+134
-4
No files matched your search
@@ -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