[MM-49751] - Turn off Inactive Server Email (#22648)
* [MM-49751] - Turn off Inactive Server Email * remove unused var --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
50a9b9bdfa
Коммит
0140e94d77
@@ -277,27 +277,6 @@ func (_m *PostStore) GetFlaggedPostsForTeam(userID string, teamID string, offset
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetLastPostRowCreateAt provides a mock function with given fields:
|
||||
func (_m *PostStore) GetLastPostRowCreateAt() (int64, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 int64
|
||||
if rf, ok := ret.Get(0).(func() int64); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetMaxPostSize provides a mock function with given fields:
|
||||
func (_m *PostStore) GetMaxPostSize() int {
|
||||
ret := _m.Called()
|
||||
|
||||
@@ -74,27 +74,6 @@ func (_m *SessionStore) Get(ctx context.Context, sessionIDOrToken string) (*mode
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetLastSessionRowCreateAt provides a mock function with given fields:
|
||||
func (_m *SessionStore) GetLastSessionRowCreateAt() (int64, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 int64
|
||||
if rf, ok := ret.Get(0).(func() int64); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetSessions provides a mock function with given fields: userID
|
||||
func (_m *SessionStore) GetSessions(userID string) ([]*model.Session, error) {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
@@ -43,7 +43,6 @@ func TestPostStore(t *testing.T, ss store.Store, s SqlStore) {
|
||||
t.Run("GetFlaggedPosts", func(t *testing.T) { testPostStoreGetFlaggedPosts(t, ss) })
|
||||
t.Run("GetFlaggedPostsForChannel", func(t *testing.T) { testPostStoreGetFlaggedPostsForChannel(t, ss) })
|
||||
t.Run("GetPostsCreatedAt", func(t *testing.T) { testPostStoreGetPostsCreatedAt(t, ss) })
|
||||
t.Run("GetLastPostRowCreateAt", func(t *testing.T) { testPostStoreGetLastPostRowCreateAt(t, ss) })
|
||||
t.Run("Overwrite", func(t *testing.T) { testPostStoreOverwrite(t, ss) })
|
||||
t.Run("OverwriteMultiple", func(t *testing.T) { testPostStoreOverwriteMultiple(t, ss) })
|
||||
t.Run("GetPostsByIds", func(t *testing.T) { testPostStoreGetPostsByIds(t, ss) })
|
||||
@@ -3361,40 +3360,6 @@ func testPostStoreGetFlaggedPostsForChannel(t *testing.T, ss store.Store) {
|
||||
require.Len(t, r.Order, 0, "should have 0 posts")
|
||||
}
|
||||
|
||||
func testPostStoreGetLastPostRowCreateAt(t *testing.T, ss store.Store) {
|
||||
teamId := model.NewId()
|
||||
channel1, err := ss.Channel().Save(&model.Channel{
|
||||
TeamId: teamId,
|
||||
DisplayName: "DisplayName1",
|
||||
Name: "channel" + model.NewId(),
|
||||
Type: model.ChannelTypeOpen,
|
||||
}, -1)
|
||||
require.NoError(t, err)
|
||||
|
||||
createTime1 := model.GetMillis() + 1
|
||||
o0 := &model.Post{}
|
||||
o0.ChannelId = channel1.Id
|
||||
o0.UserId = model.NewId()
|
||||
o0.Message = NewTestId()
|
||||
o0.CreateAt = createTime1
|
||||
o0, err = ss.Post().Save(o0)
|
||||
require.NoError(t, err)
|
||||
|
||||
createTime2 := model.GetMillis() + 2
|
||||
|
||||
o1 := &model.Post{}
|
||||
o1.ChannelId = o0.ChannelId
|
||||
o1.UserId = model.NewId()
|
||||
o1.Message = "Latest message"
|
||||
o1.CreateAt = createTime2
|
||||
_, err = ss.Post().Save(o1)
|
||||
require.NoError(t, err)
|
||||
|
||||
createAt, err := ss.Post().GetLastPostRowCreateAt()
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, createAt, createTime2)
|
||||
}
|
||||
|
||||
func testPostStoreGetPostsCreatedAt(t *testing.T, ss store.Store) {
|
||||
teamId := model.NewId()
|
||||
channel1, err := ss.Channel().Save(&model.Channel{
|
||||
|
||||
@@ -33,7 +33,6 @@ func TestSessionStore(t *testing.T, ss store.Store) {
|
||||
t.Run("SessionUpdateDeviceId2", func(t *testing.T) { testSessionUpdateDeviceId2(t, ss) })
|
||||
t.Run("UpdateExpiresAt", func(t *testing.T) { testSessionStoreUpdateExpiresAt(t, ss) })
|
||||
t.Run("UpdateLastActivityAt", func(t *testing.T) { testSessionStoreUpdateLastActivityAt(t, ss) })
|
||||
t.Run("GetLastSessionRowCreateAt", func(t *testing.T) { testSessionStoreGetLastSessionRowCreateAt(t, ss) })
|
||||
t.Run("SessionCount", func(t *testing.T) { testSessionCount(t, ss) })
|
||||
t.Run("GetSessionsExpired", func(t *testing.T) { testGetSessionsExpired(t, ss) })
|
||||
t.Run("UpdateExpiredNotify", func(t *testing.T) { testUpdateExpiredNotify(t, ss) })
|
||||
@@ -47,23 +46,6 @@ func testSessionStoreSave(t *testing.T, ss store.Store) {
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func testSessionStoreGetLastSessionRowCreateAt(t *testing.T, ss store.Store) {
|
||||
s1 := &model.Session{}
|
||||
s1.UserId = model.NewId()
|
||||
_, err := ss.Session().Save(s1)
|
||||
require.NoError(t, err)
|
||||
|
||||
latestSessionUserid := model.NewId()
|
||||
s2 := &model.Session{}
|
||||
s2.UserId = latestSessionUserid
|
||||
latestSession, err := ss.Session().Save(s2)
|
||||
require.NoError(t, err)
|
||||
|
||||
createAt, err := ss.Session().GetLastSessionRowCreateAt()
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, latestSession.CreateAt, createAt)
|
||||
}
|
||||
|
||||
func testSessionGet(t *testing.T, ss store.Store) {
|
||||
s1 := &model.Session{}
|
||||
s1.UserId = model.NewId()
|
||||
|
||||
Ссылка в новой задаче
Block a user