коммит произвёл
GitHub
родитель
62495f16bd
Коммит
150c6e7aef
@@ -871,7 +871,6 @@ type AppIface interface {
|
||||
HandleImages(previewPathList []string, thumbnailPathList []string, fileData [][]byte)
|
||||
HandleIncomingWebhook(c *request.Context, hookID string, req *model.IncomingWebhookRequest) *model.AppError
|
||||
HandleMessageExportConfig(cfg *model.Config, appCfg *model.Config)
|
||||
HasBoardProduct() (bool, error)
|
||||
HasPermissionTo(askingUserId string, permission *model.Permission) bool
|
||||
HasPermissionToChannel(c request.CTX, askingUserId string, channelID string, permission *model.Permission) bool
|
||||
HasPermissionToChannelByPost(askingUserId string, postID string, permission *model.Permission) bool
|
||||
|
||||
@@ -159,8 +159,6 @@ func SetupWithoutPreloadMigrations(tb testing.TB) *TestHelper {
|
||||
dbStore := mainHelper.GetStore()
|
||||
dbStore.DropAllTables()
|
||||
dbStore.MarkSystemRanUnitTests()
|
||||
// Only boards migrations are applied
|
||||
mainHelper.PreloadBoardsMigrationsIfNeeded()
|
||||
|
||||
return setupTestHelper(dbStore, false, true, nil, tb)
|
||||
}
|
||||
|
||||
@@ -11492,28 +11492,6 @@ func (a *OpenTracingAppLayer) HandleMessageExportConfig(cfg *model.Config, appCf
|
||||
a.app.HandleMessageExportConfig(cfg, appCfg)
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) HasBoardProduct() (bool, error) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasBoardProduct")
|
||||
|
||||
a.ctx = newCtx
|
||||
a.app.Srv().Store().SetContext(newCtx)
|
||||
defer func() {
|
||||
a.app.Srv().Store().SetContext(origCtx)
|
||||
a.ctx = origCtx
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
resultVar0, resultVar1 := a.app.HasBoardProduct()
|
||||
|
||||
if resultVar1 != nil {
|
||||
span.LogFields(spanlog.Error(resultVar1))
|
||||
ext.Error.Set(span, true)
|
||||
}
|
||||
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) HasPermissionTo(askingUserId string, permission *model.Permission) bool {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionTo")
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/mattermost/mattermost/server/public/shared/mlog"
|
||||
@@ -77,30 +75,5 @@ func (s *Server) shouldStart(product string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
if product == "boards" {
|
||||
if os.Getenv("MM_DISABLE_BOARDS") == "true" {
|
||||
s.Log().Warn("Skipping Boards start: disabled via env var")
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func (s *Server) HasBoardProduct() (bool, error) {
|
||||
prod, exists := s.services[product.BoardsKey]
|
||||
if !exists {
|
||||
return false, nil
|
||||
}
|
||||
if prod == nil {
|
||||
return false, errors.New("board product is nil")
|
||||
}
|
||||
if _, ok := prod.(product.BoardsService); !ok {
|
||||
return false, errors.New("board product key does not match its definition")
|
||||
}
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func (a *App) HasBoardProduct() (bool, error) {
|
||||
return a.Srv().HasBoardProduct()
|
||||
}
|
||||
|
||||
@@ -143,7 +143,6 @@ func setup(tb testing.TB) *TestHelper {
|
||||
dbStore := mainHelper.GetStore()
|
||||
dbStore.DropAllTables()
|
||||
dbStore.MarkSystemRanUnitTests()
|
||||
mainHelper.PreloadBoardsMigrationsIfNeeded()
|
||||
|
||||
return setupTestHelper(dbStore, false, true, tb, nil)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user