MM-21898 - Part 1: Generate and use an interface instead of *A… (#13840)
* Generate and use an interface instead of *App
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
66fc096768
Коммит
17523fa5d9
@@ -266,7 +266,7 @@ func removeUserFromChannel(a *app.App, channel *model.Channel, user *model.User,
|
||||
}
|
||||
|
||||
func removeAllUsersFromChannel(a *app.App, channel *model.Channel) {
|
||||
if err := a.Srv.Store.Channel().PermanentDeleteMembersByChannel(channel.Id); err != nil {
|
||||
if err := a.Srv().Store.Channel().PermanentDeleteMembersByChannel(channel.Id); err != nil {
|
||||
CommandPrintErrorln("Unable to remove all users from " + channel.Name + ". Error: " + err.Error())
|
||||
}
|
||||
}
|
||||
@@ -314,7 +314,7 @@ func archiveChannelsCmdF(command *cobra.Command, args []string) error {
|
||||
CommandPrintErrorln("Unable to find channel '" + args[i] + "'")
|
||||
continue
|
||||
}
|
||||
if err := a.Srv.Store.Channel().Delete(channel.Id, model.GetMillis()); err != nil {
|
||||
if err := a.Srv().Store.Channel().Delete(channel.Id, model.GetMillis()); err != nil {
|
||||
CommandPrintErrorln("Unable to archive channel '" + channel.Name + "' error: " + err.Error())
|
||||
}
|
||||
}
|
||||
@@ -409,7 +409,7 @@ func moveChannel(a *app.App, team *model.Team, channel *model.Channel, user *mod
|
||||
for _, webhook := range incomingWebhooks {
|
||||
if webhook.ChannelId == channel.Id {
|
||||
webhook.TeamId = team.Id
|
||||
if _, err := a.Srv.Store.Webhook().UpdateIncoming(webhook); err != nil {
|
||||
if _, err := a.Srv().Store.Webhook().UpdateIncoming(webhook); err != nil {
|
||||
CommandPrintErrorln("Failed to move incoming webhook '" + webhook.Id + "' to new team.")
|
||||
}
|
||||
}
|
||||
@@ -422,7 +422,7 @@ func moveChannel(a *app.App, team *model.Team, channel *model.Channel, user *mod
|
||||
for _, webhook := range outgoingWebhooks {
|
||||
if webhook.ChannelId == channel.Id {
|
||||
webhook.TeamId = team.Id
|
||||
if _, err := a.Srv.Store.Webhook().UpdateOutgoing(webhook); err != nil {
|
||||
if _, err := a.Srv().Store.Webhook().UpdateOutgoing(webhook); err != nil {
|
||||
CommandPrintErrorln("Failed to move outgoing webhook '" + webhook.Id + "' to new team.")
|
||||
}
|
||||
}
|
||||
@@ -445,7 +445,7 @@ func listChannelsCmdF(command *cobra.Command, args []string) error {
|
||||
CommandPrintErrorln("Unable to find team '" + args[i] + "'")
|
||||
continue
|
||||
}
|
||||
if channels, chanErr := a.Srv.Store.Channel().GetAll(team.Id); chanErr != nil {
|
||||
if channels, chanErr := a.Srv().Store.Channel().GetAll(team.Id); chanErr != nil {
|
||||
CommandPrintErrorln("Unable to list channels for '" + args[i] + "'")
|
||||
} else {
|
||||
for _, channel := range channels {
|
||||
@@ -477,7 +477,7 @@ func restoreChannelsCmdF(command *cobra.Command, args []string) error {
|
||||
CommandPrintErrorln("Unable to find channel '" + args[i] + "'")
|
||||
continue
|
||||
}
|
||||
if err := a.Srv.Store.Channel().SetDeleteAt(channel.Id, 0, model.GetMillis()); err != nil {
|
||||
if err := a.Srv().Store.Channel().SetDeleteAt(channel.Id, 0, model.GetMillis()); err != nil {
|
||||
CommandPrintErrorln("Unable to restore channel '" + args[i] + "'")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ func TestModifyChannel(t *testing.T) {
|
||||
channel2 := th.CreatePrivateChannel()
|
||||
|
||||
th.CheckCommand(t, "channel", "modify", "--public", th.BasicTeam.Name+":"+channel1.Name, "--username", th.BasicUser2.Email)
|
||||
res, err := th.App.Srv.Store.Channel().Get(channel1.Id, false)
|
||||
res, err := th.App.Srv().Store.Channel().Get(channel1.Id, false)
|
||||
require.Nil(t, err)
|
||||
assert.Equal(t, model.CHANNEL_OPEN, res.Type)
|
||||
|
||||
@@ -247,7 +247,7 @@ func TestModifyChannel(t *testing.T) {
|
||||
pchannel2 := th.CreatePublicChannel()
|
||||
|
||||
th.CheckCommand(t, "channel", "modify", "--private", th.BasicTeam.Name+":"+pchannel1.Name, "--username", th.BasicUser2.Email)
|
||||
res, err = th.App.Srv.Store.Channel().Get(pchannel1.Id, false)
|
||||
res, err = th.App.Srv().Store.Channel().Get(pchannel1.Id, false)
|
||||
require.Nil(t, err)
|
||||
assert.Equal(t, model.CHANNEL_PRIVATE, res.Type)
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ func getChannelFromChannelArg(a *app.App, channelArg string) *model.Channel {
|
||||
return nil
|
||||
}
|
||||
|
||||
if result, err := a.Srv.Store.Channel().GetByNameIncludeDeleted(team.Id, channelPart, true); err == nil {
|
||||
if result, err := a.Srv().Store.Channel().GetByNameIncludeDeleted(team.Id, channelPart, true); err == nil {
|
||||
channel = result
|
||||
} else {
|
||||
fmt.Println(err.Error())
|
||||
@@ -51,7 +51,7 @@ func getChannelFromChannelArg(a *app.App, channelArg string) *model.Channel {
|
||||
}
|
||||
|
||||
if channel == nil {
|
||||
if ch, errCh := a.Srv.Store.Channel().Get(channelPart, true); errCh == nil {
|
||||
if ch, errCh := a.Srv().Store.Channel().Get(channelPart, true); errCh == nil {
|
||||
channel = ch
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ func listCommandCmdF(command *cobra.Command, args []string) error {
|
||||
CommandPrintErrorln("Unable to find team '" + args[i] + "'")
|
||||
continue
|
||||
}
|
||||
commands, err := a.Srv.Store.Command().GetByTeam(team.Id)
|
||||
commands, err := a.Srv().Store.Command().GetByTeam(team.Id)
|
||||
if err != nil {
|
||||
CommandPrintErrorln("Unable to list commands for '" + args[i] + "'")
|
||||
continue
|
||||
|
||||
@@ -47,14 +47,14 @@ func getCommandFromCommandArg(a *app.App, commandArg string) *model.Command {
|
||||
return nil
|
||||
}
|
||||
var err *model.AppError
|
||||
command, err = a.Srv.Store.Command().GetByTrigger(team.Id, commandPart)
|
||||
command, err = a.Srv().Store.Command().GetByTrigger(team.Id, commandPart)
|
||||
if err != nil {
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
if command == nil {
|
||||
command, _ = a.Srv.Store.Command().Get(commandPart)
|
||||
command, _ = a.Srv().Store.Command().Get(commandPart)
|
||||
}
|
||||
|
||||
return command
|
||||
|
||||
@@ -117,7 +117,7 @@ func scheduleExportCmdF(command *cobra.Command, args []string) error {
|
||||
return errors.New("timeoutSeconds must be a positive integer")
|
||||
}
|
||||
|
||||
if messageExportI := a.MessageExport; messageExportI != nil {
|
||||
if messageExportI := a.MessageExport(); messageExportI != nil {
|
||||
ctx := context.Background()
|
||||
if timeoutSeconds > 0 {
|
||||
var cancel context.CancelFunc
|
||||
@@ -152,11 +152,11 @@ func buildExportCmdF(format string) func(command *cobra.Command, args []string)
|
||||
return errors.New("exportFrom must be a positive integer")
|
||||
}
|
||||
|
||||
if a.MessageExport == nil {
|
||||
if a.MessageExport() == nil {
|
||||
CommandPrettyPrintln("MessageExport feature not available")
|
||||
}
|
||||
|
||||
err2 := a.MessageExport.RunExport(format, startTime)
|
||||
err2 := a.MessageExport().RunExport(format, startTime)
|
||||
if err2 != nil {
|
||||
return err2
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ func integrityCmdF(command *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
verboseFlag, _ := command.Flags().GetBool("verbose")
|
||||
results := a.Srv.Store.CheckIntegrity()
|
||||
results := a.Srv().Store.CheckIntegrity()
|
||||
for result := range results {
|
||||
if result.Err != nil {
|
||||
fmt.Fprintf(os.Stderr, "%s\n", result.Err.Error())
|
||||
|
||||
@@ -47,12 +47,12 @@ func jobserverCmdF(command *cobra.Command, args []string) error {
|
||||
defer mlog.Info("Stopped Mattermost job server")
|
||||
|
||||
if !noJobs {
|
||||
a.Srv.Jobs.StartWorkers()
|
||||
defer a.Srv.Jobs.StopWorkers()
|
||||
a.Srv().Jobs.StartWorkers()
|
||||
defer a.Srv().Jobs.StopWorkers()
|
||||
}
|
||||
if !noSchedule {
|
||||
a.Srv.Jobs.StartSchedulers()
|
||||
defer a.Srv.Jobs.StopSchedulers()
|
||||
a.Srv().Jobs.StartSchedulers()
|
||||
defer a.Srv().Jobs.StopSchedulers()
|
||||
}
|
||||
|
||||
signalChan := make(chan os.Signal, 1)
|
||||
|
||||
@@ -45,7 +45,7 @@ func ldapSyncCmdF(command *cobra.Command, args []string) error {
|
||||
}
|
||||
defer a.Shutdown()
|
||||
|
||||
if ldapI := a.Ldap; ldapI != nil {
|
||||
if ldapI := a.Ldap(); ldapI != nil {
|
||||
job, err := ldapI.StartSynchronizeJob(true)
|
||||
if err != nil || job.Status == model.JOB_STATUS_ERROR || job.Status == model.JOB_STATUS_CANCELED {
|
||||
CommandPrintErrorln("ERROR: AD/LDAP Synchronization please check the server logs")
|
||||
@@ -65,7 +65,7 @@ func ldapIdMigrateCmdF(command *cobra.Command, args []string) error {
|
||||
defer a.Shutdown()
|
||||
|
||||
toAttribute := args[0]
|
||||
if ldapI := a.Ldap; ldapI != nil {
|
||||
if ldapI := a.Ldap(); ldapI != nil {
|
||||
if err := ldapI.MigrateIDAttribute(toAttribute); err != nil {
|
||||
CommandPrintErrorln("ERROR: AD/LDAP IdAttribute migration failed! Error: " + err.Error())
|
||||
} else {
|
||||
|
||||
@@ -46,7 +46,7 @@ func resetCmdF(command *cobra.Command, args []string) error {
|
||||
}
|
||||
}
|
||||
|
||||
a.Srv.Store.DropAllTables()
|
||||
a.Srv().Store.DropAllTables()
|
||||
CommandPrettyPrintln("Database successfully reset")
|
||||
|
||||
return nil
|
||||
|
||||
@@ -16,13 +16,13 @@ func TestAssignRole(t *testing.T) {
|
||||
|
||||
th.CheckCommand(t, "roles", "system_admin", th.BasicUser.Email)
|
||||
|
||||
user, err := th.App.Srv.Store.User().GetByEmail(th.BasicUser.Email)
|
||||
user, err := th.App.Srv().Store.User().GetByEmail(th.BasicUser.Email)
|
||||
require.Nil(t, err)
|
||||
assert.Equal(t, "system_user system_admin", user.Roles)
|
||||
|
||||
th.CheckCommand(t, "roles", "member", th.BasicUser.Email)
|
||||
|
||||
user, err = th.App.Srv.Store.User().GetByEmail(th.BasicUser.Email)
|
||||
user, err = th.App.Srv().Store.User().GetByEmail(th.BasicUser.Email)
|
||||
require.Nil(t, err)
|
||||
assert.Equal(t, "system_user", user.Roles)
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ func TestLeaveTeam(t *testing.T) {
|
||||
|
||||
require.False(t, found, "profile should not be on team")
|
||||
|
||||
teams, err := th.App.Srv.Store.Team().GetTeamsByUserId(th.BasicUser.Id)
|
||||
teams, err := th.App.Srv().Store.Team().GetTeamsByUserId(th.BasicUser.Id)
|
||||
require.Nil(t, err)
|
||||
require.Equal(t, 0, len(teams), "Shouldn't be in team")
|
||||
}
|
||||
|
||||
@@ -19,11 +19,11 @@ func getTeamsFromTeamArgs(a *app.App, teamArgs []string) []*model.Team {
|
||||
|
||||
func getTeamFromTeamArg(a *app.App, teamArg string) *model.Team {
|
||||
var team *model.Team
|
||||
team, err := a.Srv.Store.Team().GetByName(teamArg)
|
||||
team, err := a.Srv().Store.Team().GetByName(teamArg)
|
||||
|
||||
if err != nil {
|
||||
var t *model.Team
|
||||
if t, err = a.Srv.Store.Team().Get(teamArg); err == nil {
|
||||
if t, err = a.Srv().Store.Team().Get(teamArg); err == nil {
|
||||
team = t
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,13 +53,13 @@ func webClientTestsCmdF(command *cobra.Command, args []string) error {
|
||||
defer a.Shutdown()
|
||||
|
||||
utils.InitTranslations(a.Config().LocalizationSettings)
|
||||
serverErr := a.Srv.Start()
|
||||
serverErr := a.Srv().Start()
|
||||
if serverErr != nil {
|
||||
return serverErr
|
||||
}
|
||||
|
||||
api4.Init(a, a.Srv.AppOptions, a.Srv.Router)
|
||||
wsapi.Init(a, a.Srv.WebSocketRouter)
|
||||
api4.Init(a, a.Srv().AppOptions, a.Srv().Router)
|
||||
wsapi.Init(a, a.Srv().WebSocketRouter)
|
||||
a.UpdateConfig(setupClientTests)
|
||||
runWebClientTests()
|
||||
|
||||
@@ -74,13 +74,13 @@ func serverForWebClientTestsCmdF(command *cobra.Command, args []string) error {
|
||||
defer a.Shutdown()
|
||||
|
||||
utils.InitTranslations(a.Config().LocalizationSettings)
|
||||
serverErr := a.Srv.Start()
|
||||
serverErr := a.Srv().Start()
|
||||
if serverErr != nil {
|
||||
return serverErr
|
||||
}
|
||||
|
||||
api4.Init(a, a.Srv.AppOptions, a.Srv.Router)
|
||||
wsapi.Init(a, a.Srv.WebSocketRouter)
|
||||
api4.Init(a, a.Srv().AppOptions, a.Srv().Router)
|
||||
wsapi.Init(a, a.Srv().WebSocketRouter)
|
||||
a.UpdateConfig(setupClientTests)
|
||||
|
||||
c := make(chan os.Signal, 1)
|
||||
|
||||
@@ -513,7 +513,7 @@ func botToUser(command *cobra.Command, args []string, a *app.App) error {
|
||||
}
|
||||
}
|
||||
|
||||
appErr = a.Srv.Store.Bot().PermanentDelete(user.Id)
|
||||
appErr = a.Srv().Store.Bot().PermanentDelete(user.Id)
|
||||
if appErr != nil {
|
||||
return fmt.Errorf("Unable to delete bot. Error: %s", appErr.Error())
|
||||
}
|
||||
@@ -624,7 +624,7 @@ func resetUserPasswordCmdF(command *cobra.Command, args []string) error {
|
||||
}
|
||||
password := args[1]
|
||||
|
||||
if err := a.Srv.Store.User().UpdatePassword(user.Id, model.HashPassword(password)); err != nil {
|
||||
if err := a.Srv().Store.User().UpdatePassword(user.Id, model.HashPassword(password)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -809,7 +809,7 @@ func migrateAuthToLdapCmdF(command *cobra.Command, args []string) error {
|
||||
forceFlag, _ := command.Flags().GetBool("force")
|
||||
dryRunFlag, _ := command.Flags().GetBool("dryRun")
|
||||
|
||||
if migrate := a.AccountMigration; migrate != nil {
|
||||
if migrate := a.AccountMigration(); migrate != nil {
|
||||
if err := migrate.MigrateToLdap(fromAuth, matchField, forceFlag, dryRunFlag); err != nil {
|
||||
return errors.New("Error while migrating users: " + err.Error())
|
||||
}
|
||||
@@ -865,7 +865,7 @@ func migrateAuthToSamlCmdF(command *cobra.Command, args []string) error {
|
||||
fromAuth = ""
|
||||
}
|
||||
|
||||
if migrate := a.AccountMigration; migrate != nil {
|
||||
if migrate := a.AccountMigration(); migrate != nil {
|
||||
if err := migrate.MigrateToSaml(fromAuth, matches, autoFlag, dryRunFlag); err != nil {
|
||||
return errors.New("Error while migrating users: " + err.Error())
|
||||
}
|
||||
@@ -894,7 +894,7 @@ func verifyUserCmdF(command *cobra.Command, args []string) error {
|
||||
CommandPrintErrorln("Unable to find user '" + args[i] + "'")
|
||||
continue
|
||||
}
|
||||
if _, err := a.Srv.Store.User().VerifyEmail(user.Id, user.Email); err != nil {
|
||||
if _, err := a.Srv().Store.User().VerifyEmail(user.Id, user.Email); err != nil {
|
||||
CommandPrintErrorln("Unable to verify '" + args[i] + "' email. Error: " + err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ func TestCreateUserWithoutTeam(t *testing.T) {
|
||||
|
||||
th.CheckCommand(t, "user", "create", "--email", email, "--password", "mypassword1", "--username", username)
|
||||
|
||||
user, err := th.App.Srv.Store.User().GetByEmail(email)
|
||||
user, err := th.App.Srv().Store.User().GetByEmail(email)
|
||||
require.Nil(t, err)
|
||||
|
||||
require.Equal(t, email, user.Email)
|
||||
@@ -81,10 +81,10 @@ func TestChangeUserEmail(t *testing.T) {
|
||||
newEmail := model.NewId() + "@mattermost-test.com"
|
||||
|
||||
th.CheckCommand(t, "user", "email", th.BasicUser.Username, newEmail)
|
||||
_, err := th.App.Srv.Store.User().GetByEmail(th.BasicUser.Email)
|
||||
_, err := th.App.Srv().Store.User().GetByEmail(th.BasicUser.Email)
|
||||
require.NotNil(t, err, "should've updated to the new email")
|
||||
|
||||
user, err := th.App.Srv.Store.User().GetByEmail(newEmail)
|
||||
user, err := th.App.Srv().Store.User().GetByEmail(newEmail)
|
||||
require.Nil(t, err)
|
||||
|
||||
require.Equal(t, user.Email, newEmail, "should've updated to the new email")
|
||||
@@ -114,7 +114,7 @@ func TestDeleteUserBotUser(t *testing.T) {
|
||||
defer th.TearDown()
|
||||
|
||||
th.CheckCommand(t, "user", "delete", th.BasicUser.Username, "--confirm")
|
||||
_, err := th.App.Srv.Store.User().Get(th.BasicUser.Id)
|
||||
_, err := th.App.Srv().Store.User().Get(th.BasicUser.Id)
|
||||
require.Error(t, err)
|
||||
|
||||
// Make a bot
|
||||
@@ -123,16 +123,16 @@ func TestDeleteUserBotUser(t *testing.T) {
|
||||
Description: "Delete me!",
|
||||
OwnerId: model.NewId(),
|
||||
}
|
||||
user, err := th.App.Srv.Store.User().Save(model.UserFromBot(bot))
|
||||
user, err := th.App.Srv().Store.User().Save(model.UserFromBot(bot))
|
||||
require.Nil(t, err)
|
||||
bot.UserId = user.Id
|
||||
bot, err = th.App.Srv.Store.Bot().Save(bot)
|
||||
bot, err = th.App.Srv().Store.Bot().Save(bot)
|
||||
require.Nil(t, err)
|
||||
|
||||
th.CheckCommand(t, "user", "delete", bot.Username, "--confirm")
|
||||
_, err = th.App.Srv.Store.User().Get(user.Id)
|
||||
_, err = th.App.Srv().Store.User().Get(user.Id)
|
||||
require.Error(t, err)
|
||||
_, err = th.App.Srv.Store.Bot().Get(user.Id, true)
|
||||
_, err = th.App.Srv().Store.Bot().Get(user.Id, true)
|
||||
require.Error(t, err)
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ func TestConvertUser(t *testing.T) {
|
||||
|
||||
t.Run("Convert to bot from username", func(t *testing.T) {
|
||||
th.CheckCommand(t, "user", "convert", th.BasicUser.Username, "anotherinvaliduser", "--bot")
|
||||
_, err := th.App.Srv.Store.Bot().Get(th.BasicUser.Id, false)
|
||||
_, err := th.App.Srv().Store.Bot().Get(th.BasicUser.Id, false)
|
||||
require.Nil(t, err)
|
||||
})
|
||||
|
||||
@@ -173,13 +173,13 @@ func TestConvertUser(t *testing.T) {
|
||||
err := th.RunCommand(t, "user", "convert", th.BasicUser.Username, "--user",
|
||||
"--password", "password")
|
||||
require.Nil(t, err)
|
||||
_, err = th.App.Srv.Store.Bot().Get(th.BasicUser.Id, false)
|
||||
_, err = th.App.Srv().Store.Bot().Get(th.BasicUser.Id, false)
|
||||
require.NotNil(t, err)
|
||||
})
|
||||
|
||||
t.Run("Convert to bot from email", func(t *testing.T) {
|
||||
th.CheckCommand(t, "user", "convert", th.BasicUser2.Email, "--bot")
|
||||
_, err := th.App.Srv.Store.Bot().Get(th.BasicUser2.Id, false)
|
||||
_, err := th.App.Srv().Store.Bot().Get(th.BasicUser2.Id, false)
|
||||
require.Nil(t, err)
|
||||
})
|
||||
|
||||
@@ -195,10 +195,10 @@ func TestConvertUser(t *testing.T) {
|
||||
"--system_admin")
|
||||
require.Nil(t, err)
|
||||
|
||||
_, err = th.App.Srv.Store.Bot().Get(th.BasicUser2.Id, false)
|
||||
_, err = th.App.Srv().Store.Bot().Get(th.BasicUser2.Id, false)
|
||||
require.NotNil(t, err)
|
||||
|
||||
user, appErr := th.App.Srv.Store.User().Get(th.BasicUser2.Id)
|
||||
user, appErr := th.App.Srv().Store.User().Get(th.BasicUser2.Id)
|
||||
require.Nil(t, appErr)
|
||||
require.Equal(t, "newusername", user.Username)
|
||||
require.Equal(t, "valid@email.com", user.Email)
|
||||
|
||||
@@ -18,17 +18,17 @@ func getUsersFromUserArgs(a *app.App, userArgs []string) []*model.User {
|
||||
}
|
||||
|
||||
func getUserFromUserArg(a *app.App, userArg string) *model.User {
|
||||
user, _ := a.Srv.Store.User().GetByEmail(userArg)
|
||||
user, _ := a.Srv().Store.User().GetByEmail(userArg)
|
||||
|
||||
if user == nil {
|
||||
var err *model.AppError
|
||||
if user, err = a.Srv.Store.User().GetByUsername(userArg); err == nil {
|
||||
if user, err = a.Srv().Store.User().GetByUsername(userArg); err == nil {
|
||||
return user
|
||||
}
|
||||
}
|
||||
|
||||
if user == nil {
|
||||
user, _ = a.Srv.Store.User().Get(userArg)
|
||||
user, _ = a.Srv().Store.User().Get(userArg)
|
||||
}
|
||||
|
||||
return user
|
||||
|
||||
@@ -36,5 +36,5 @@ func printVersion(a *app.App) {
|
||||
CommandPrintln("Build Date: " + model.BuildDate)
|
||||
CommandPrintln("Build Hash: " + model.BuildHash)
|
||||
CommandPrintln("Build Enterprise Ready: " + model.BuildEnterpriseReady)
|
||||
CommandPrintln("DB Version: " + a.Srv.Store.GetCurrentSchemaVersion())
|
||||
CommandPrintln("DB Version: " + a.Srv().Store.GetCurrentSchemaVersion())
|
||||
}
|
||||
|
||||
@@ -114,13 +114,13 @@ func listWebhookCmdF(command *cobra.Command, args []string) error {
|
||||
// Fetch all hooks with a very large limit so we get them all.
|
||||
incomingResult := make(chan store.StoreResult, 1)
|
||||
go func() {
|
||||
incomingHooks, err := app.Srv.Store.Webhook().GetIncomingByTeam(team.Id, 0, 100000000)
|
||||
incomingHooks, err := app.Srv().Store.Webhook().GetIncomingByTeam(team.Id, 0, 100000000)
|
||||
incomingResult <- store.StoreResult{Data: incomingHooks, Err: err}
|
||||
close(incomingResult)
|
||||
}()
|
||||
outgoingResult := make(chan store.StoreResult, 1)
|
||||
go func() {
|
||||
outgoingHooks, err := app.Srv.Store.Webhook().GetOutgoingByTeam(team.Id, 0, 100000000)
|
||||
outgoingHooks, err := app.Srv().Store.Webhook().GetOutgoingByTeam(team.Id, 0, 100000000)
|
||||
outgoingResult <- store.StoreResult{Data: outgoingHooks, Err: err}
|
||||
close(outgoingResult)
|
||||
}()
|
||||
|
||||
Ссылка в новой задаче
Block a user