Adds includeDeleted flag to get remote cluster app and store methods (#28182)

Этот коммит содержится в:
Miguel de la Cruz
2024-09-13 23:08:53 +02:00
коммит произвёл GitHub
родитель 46ca7747f8
Коммит cae456de2d
19 изменённых файлов: 78 добавлений и 57 удалений

Просмотреть файл

@@ -57,7 +57,7 @@ func callback(listener TopicListener, msg model.RemoteClusterMsg, rc *model.Remo
func (rcs *Service) ReceiveInviteConfirmation(confirm model.RemoteClusterInvite) (*model.RemoteCluster, error) {
store := rcs.server.GetStore().RemoteCluster()
rc, err := store.Get(confirm.RemoteId)
rc, err := store.Get(confirm.RemoteId, false)
if err != nil {
return nil, fmt.Errorf("cannot accept invite confirmation for remote %s: %w", confirm.RemoteId, err)
}

Просмотреть файл

@@ -134,7 +134,7 @@ func (scs *Service) InviteRemoteToChannel(channelID, remoteID, userID string, sh
}
}
rc, err := rcStore.Get(remoteID)
rc, err := rcStore.Get(remoteID, false)
if err != nil {
return model.NewAppError("InviteRemoteToChannel", "api.command_share.remote_id_invalid.error",
map[string]any{"Error": err.Error()}, "", http.StatusInternalServerError).Wrap(err)

Просмотреть файл

@@ -395,13 +395,10 @@ func (scs *Service) processTask(task syncTask) error {
remotesMap[r.RemoteId] = r
}
} else {
rc, err := scs.server.GetStore().RemoteCluster().Get(task.remoteID)
rc, err := scs.server.GetStore().RemoteCluster().Get(task.remoteID, false)
if err != nil {
return err
}
if rc.DeleteAt != 0 {
return fmt.Errorf("Processing task for a deleted remote cluster '%s'", task.remoteID)
}
if !rc.IsOnline() {
return fmt.Errorf("Failed updating shared channel '%s' for offline remote cluster '%s'", task.channelID, rc.DisplayName)
}