[MM-15122] Migrate "WebHook.GetIncomingByTeam" to Sync by default (#10631)

Этот коммит содержится в:
Siyuan Liu
2019-04-22 08:29:55 -07:00
коммит произвёл Jesse Hallam
родитель 1e92646646
Коммит 434f343f69
6 изменённых файлов: 35 добавлений и 26 удалений

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

@@ -8,6 +8,7 @@ import (
"strings"
"github.com/mattermost/mattermost-server/model"
"github.com/mattermost/mattermost-server/store"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
@@ -101,7 +102,12 @@ func listWebhookCmdF(command *cobra.Command, args []string) error {
}
// Fetch all hooks with a very large limit so we get them all.
incomingResult := app.Srv.Store.Webhook().GetIncomingByTeam(team.Id, 0, 100000000)
incomingResult := make(chan store.StoreResult, 1)
go func() {
incomingHooks, err := app.Srv.Store.Webhook().GetIncomingByTeam(team.Id, 0, 100000000)
incomingResult <- store.StoreResult{Data: incomingHooks, Err: err}
close(incomingResult)
}()
outgoingResult := app.Srv.Store.Webhook().GetOutgoingByTeam(team.Id, 0, 100000000)
if result := <-incomingResult; result.Err == nil {