Migrate to stateless app.App (#17542)
* add request context * move initialialization to server * use app interface instead of global app functions * remove app context from webconn * cleanup * remove duplicated services * move context to separate package * remove finalize init method and move content to NewServer function * restart workers and schedulers after adding license for tests * reflect review comments Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c09369f14a
Коммит
5ea06e51d0
@@ -23,7 +23,7 @@ func TestMsgProvider(t *testing.T) {
|
||||
th.removePermissionFromRole(model.PERMISSION_CREATE_DIRECT_CHANNEL.Id, model.SYSTEM_USER_ROLE_ID)
|
||||
|
||||
// Check without permission to create a DM channel.
|
||||
resp := cmd.DoCommand(th.App, &model.CommandArgs{
|
||||
resp := cmd.DoCommand(th.App, th.Context, &model.CommandArgs{
|
||||
T: i18n.IdentityTfunc(),
|
||||
SiteURL: "http://test.url",
|
||||
TeamId: team.Id,
|
||||
@@ -37,7 +37,7 @@ func TestMsgProvider(t *testing.T) {
|
||||
th.addPermissionToRole(model.PERMISSION_CREATE_DIRECT_CHANNEL.Id, model.SYSTEM_USER_ROLE_ID)
|
||||
|
||||
// Check with permission to create a DM channel.
|
||||
resp = cmd.DoCommand(th.App, &model.CommandArgs{
|
||||
resp = cmd.DoCommand(th.App, th.Context, &model.CommandArgs{
|
||||
T: i18n.IdentityTfunc(),
|
||||
SiteURL: "http://test.url",
|
||||
TeamId: team.Id,
|
||||
@@ -48,7 +48,7 @@ func TestMsgProvider(t *testing.T) {
|
||||
assert.Equal(t, "http://test.url/"+team.Name+"/channels/"+channelName, resp.GotoLocation)
|
||||
|
||||
// Check without permission to post to an existing DM channel.
|
||||
resp = cmd.DoCommand(th.App, &model.CommandArgs{
|
||||
resp = cmd.DoCommand(th.App, th.Context, &model.CommandArgs{
|
||||
T: i18n.IdentityTfunc(),
|
||||
SiteURL: "http://test.url",
|
||||
TeamId: team.Id,
|
||||
@@ -66,7 +66,7 @@ func TestMsgProvider(t *testing.T) {
|
||||
th.linkUserToTeam(guest, th.BasicTeam)
|
||||
th.addUserToChannel(guest, th.BasicChannel)
|
||||
|
||||
resp = cmd.DoCommand(th.App, &model.CommandArgs{
|
||||
resp = cmd.DoCommand(th.App, th.Context, &model.CommandArgs{
|
||||
T: i18n.IdentityTfunc(),
|
||||
SiteURL: "http://test.url",
|
||||
TeamId: th.BasicTeam.Id,
|
||||
@@ -80,7 +80,7 @@ func TestMsgProvider(t *testing.T) {
|
||||
th.linkUserToTeam(user, th.BasicTeam)
|
||||
th.addUserToChannel(user, th.BasicChannel)
|
||||
|
||||
resp = cmd.DoCommand(th.App, &model.CommandArgs{
|
||||
resp = cmd.DoCommand(th.App, th.Context, &model.CommandArgs{
|
||||
T: i18n.IdentityTfunc(),
|
||||
SiteURL: "http://test.url",
|
||||
TeamId: th.BasicTeam.Id,
|
||||
|
||||
Ссылка в новой задаче
Block a user