Reprioritize notification services when updated.
This commit is contained in:
parent
257a4968ec
commit
414ca0a95c
2 changed files with 5 additions and 0 deletions
|
|
@ -39,6 +39,9 @@ func NewManager(logger *slog.Logger) (nm Manager) {
|
|||
func (nm *Manager) AddService(service Service) {
|
||||
service.SetExists(true)
|
||||
nm.services = append(nm.services, service)
|
||||
}
|
||||
|
||||
func (nm *Manager) Reprioritize() {
|
||||
slices.SortFunc(nm.services, func(a, b Service) int {
|
||||
if a.GetPrio() < b.GetPrio() {
|
||||
return -1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue