коммит произвёл
GitHub
родитель
b45ff0be5d
Коммит
717a4d04a9
@@ -20,7 +20,7 @@ func (r *Response) IsSuccess() bool {
|
||||
}
|
||||
|
||||
// SetPayload serializes an arbitrary struct as a RawMessage.
|
||||
func (r *Response) SetPayload(v interface{}) error {
|
||||
func (r *Response) SetPayload(v any) error {
|
||||
raw, err := json.Marshal(v)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
//
|
||||
// There are a number of send channels (`MaxConcurrentSends`) to allow for sending to multiple
|
||||
// remotes concurrently, while preserving message order for each remote.
|
||||
func (rcs *Service) enqueueTask(ctx context.Context, remoteId string, task interface{}) error {
|
||||
func (rcs *Service) enqueueTask(ctx context.Context, remoteId string, task any) error {
|
||||
if ctx == nil {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ type ConnectionStateListener func(rc *model.RemoteCluster, online bool)
|
||||
type Service struct {
|
||||
server ServerIface
|
||||
httpClient *http.Client
|
||||
send []chan interface{}
|
||||
send []chan any
|
||||
|
||||
// everything below guarded by `mux`
|
||||
mux sync.RWMutex
|
||||
@@ -120,9 +120,9 @@ func NewRemoteClusterService(server ServerIface) (*Service, error) {
|
||||
connectionStateListeners: make(map[string]ConnectionStateListener),
|
||||
}
|
||||
|
||||
service.send = make([]chan interface{}, MaxConcurrentSends)
|
||||
service.send = make([]chan any, MaxConcurrentSends)
|
||||
for i := range service.send {
|
||||
service.send[i] = make(chan interface{}, SendChanBuffer)
|
||||
service.send[i] = make(chan any, SendChanBuffer)
|
||||
}
|
||||
|
||||
return service, nil
|
||||
|
||||
Ссылка в новой задаче
Block a user