MSP-5494 migrate linter to v2
This commit is contained in:
1 parent
82f6d624ba
commit
10e74db016
2 files changed
+82
-65
No files matched your search
@@ -147,6 +147,25 @@ func (s Service) NotifyBackendsChanged(ctx context.Context, moduleId string) err
|
||||
return s.notifyBackendsChanged(ctx, moduleId, module.Name, conns)
|
||||
}
|
||||
|
||||
func (s Service) SubscribeToRoutingChanges(ctx context.Context, conn *etp.Conn) error {
|
||||
err := s.notifyRoutingChanged(ctx, cluster.ConfigSendRoutesWhenConnected, []*etp.Conn{conn})
|
||||
if err != nil {
|
||||
return errors.WithMessage(err, "notify routing changed")
|
||||
}
|
||||
|
||||
s.rooms.Join(conn, RoutingChangingRoom())
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s Service) NotifyRoutingChanged(ctx context.Context) error {
|
||||
conns := s.rooms.ToBroadcast(RoutingChangingRoom())
|
||||
if len(conns) == 0 {
|
||||
return nil
|
||||
}
|
||||
return s.notifyRoutingChanged(ctx, cluster.ConfigSendRoutesChanged, conns)
|
||||
}
|
||||
|
||||
func (s Service) notifyBackendsChanged(
|
||||
ctx context.Context,
|
||||
moduleId string,
|
||||
@@ -173,25 +192,6 @@ func (s Service) notifyBackendsChanged(
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s Service) SubscribeToRoutingChanges(ctx context.Context, conn *etp.Conn) error {
|
||||
err := s.notifyRoutingChanged(ctx, cluster.ConfigSendRoutesWhenConnected, []*etp.Conn{conn})
|
||||
if err != nil {
|
||||
return errors.WithMessage(err, "notify routing changed")
|
||||
}
|
||||
|
||||
s.rooms.Join(conn, RoutingChangingRoom())
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s Service) NotifyRoutingChanged(ctx context.Context) error {
|
||||
conns := s.rooms.ToBroadcast(RoutingChangingRoom())
|
||||
if len(conns) == 0 {
|
||||
return nil
|
||||
}
|
||||
return s.notifyRoutingChanged(ctx, cluster.ConfigSendRoutesChanged, conns)
|
||||
}
|
||||
|
||||
func (s Service) notifyRoutingChanged(ctx context.Context, event string, conns []*etp.Conn) error {
|
||||
ctx = db.NoneConsistency().ToContext(ctx)
|
||||
backends, err := s.backendRepo.All(ctx)
|
||||
|
||||
Reference in new issue
Block a user