Skip to content

Commit

Permalink
Fix collection initialization (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
ders authored Jan 15, 2024
1 parent d5725d0 commit ad94a6a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ func (c *Collection) Add(s Service) {

c.services = append(c.services, s)
s.Subscribe(c.id, c.updates)

// Trigger an update to include the state of the newly added service.
go func() {
c.updates <- Notification{}
}()
}

// StateCount returns the number of monitored services currently in the given state.
Expand Down

0 comments on commit ad94a6a

Please sign in to comment.