jobstore (#15250)
* Migration completed * Modify test case * Update en.json * Fix layers * Lint: remove unnecessary use of sprint * trigger CI * fix error * Fixes * fix test Co-authored-by: Rodrigo Villablanca <villa061004@gmail.com> Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
b451b3cf86
Коммит
78766625df
@@ -4,6 +4,8 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
tjobs "github.com/mattermost/mattermost-server/v5/jobs/interfaces"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
@@ -42,7 +44,7 @@ func GetMigrationState(migration string, store store.Store) (string, *model.Job,
|
||||
|
||||
jobs, err := store.Job().GetAllByType(model.JOB_TYPE_MIGRATIONS)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
return "", nil, model.NewAppError("GetMigrationState", "app.job.get_all.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
for _, job := range jobs {
|
||||
|
||||
@@ -56,8 +56,8 @@ func TestGetMigrationState(t *testing.T) {
|
||||
Type: model.JOB_TYPE_MIGRATIONS,
|
||||
}
|
||||
|
||||
j1, err = th.App.Srv().Store.Job().Save(j1)
|
||||
require.Nil(t, err)
|
||||
j1, nErr = th.App.Srv().Store.Job().Save(j1)
|
||||
require.Nil(t, nErr)
|
||||
|
||||
state, job, err = GetMigrationState(migrationKey, th.App.Srv().Store)
|
||||
assert.Nil(t, err)
|
||||
@@ -75,8 +75,8 @@ func TestGetMigrationState(t *testing.T) {
|
||||
Type: model.JOB_TYPE_MIGRATIONS,
|
||||
}
|
||||
|
||||
j2, err = th.App.Srv().Store.Job().Save(j2)
|
||||
require.Nil(t, err)
|
||||
j2, nErr = th.App.Srv().Store.Job().Save(j2)
|
||||
require.Nil(t, nErr)
|
||||
|
||||
state, job, err = GetMigrationState(migrationKey, th.App.Srv().Store)
|
||||
assert.Nil(t, err)
|
||||
@@ -94,8 +94,8 @@ func TestGetMigrationState(t *testing.T) {
|
||||
Type: model.JOB_TYPE_MIGRATIONS,
|
||||
}
|
||||
|
||||
j3, err = th.App.Srv().Store.Job().Save(j3)
|
||||
require.Nil(t, err)
|
||||
j3, nErr = th.App.Srv().Store.Job().Save(j3)
|
||||
require.Nil(t, nErr)
|
||||
|
||||
state, job, err = GetMigrationState(migrationKey, th.App.Srv().Store)
|
||||
assert.Nil(t, err)
|
||||
|
||||
Ссылка в новой задаче
Block a user