коммит произвёл
GitHub
родитель
b15c0484c6
Коммит
87dfbc13c0
@@ -70,8 +70,8 @@ func TestGetSessionIdleTimeoutInMinutes(t *testing.T) {
|
||||
|
||||
// Test regular session, should timeout
|
||||
time := session.LastActivityAt - (1000 * 60 * 6)
|
||||
err = th.App.Srv().Store.Session().UpdateLastActivityAt(session.Id, time)
|
||||
require.Nil(t, err)
|
||||
nErr := th.App.Srv().Store.Session().UpdateLastActivityAt(session.Id, time)
|
||||
require.Nil(t, nErr)
|
||||
th.App.ClearSessionCacheForUserSkipClusterSend(session.UserId)
|
||||
|
||||
rsession, err = th.App.GetSession(session.Token)
|
||||
@@ -88,8 +88,8 @@ func TestGetSessionIdleTimeoutInMinutes(t *testing.T) {
|
||||
|
||||
session, _ = th.App.CreateSession(session)
|
||||
time = session.LastActivityAt - (1000 * 60 * 6)
|
||||
err = th.App.Srv().Store.Session().UpdateLastActivityAt(session.Id, time)
|
||||
require.Nil(t, err)
|
||||
nErr = th.App.Srv().Store.Session().UpdateLastActivityAt(session.Id, time)
|
||||
require.Nil(t, nErr)
|
||||
th.App.ClearSessionCacheForUserSkipClusterSend(session.UserId)
|
||||
|
||||
_, err = th.App.GetSession(session.Token)
|
||||
@@ -103,8 +103,8 @@ func TestGetSessionIdleTimeoutInMinutes(t *testing.T) {
|
||||
|
||||
session, _ = th.App.CreateSession(session)
|
||||
time = session.LastActivityAt - (1000 * 60 * 6)
|
||||
err = th.App.Srv().Store.Session().UpdateLastActivityAt(session.Id, time)
|
||||
require.Nil(t, err)
|
||||
nErr = th.App.Srv().Store.Session().UpdateLastActivityAt(session.Id, time)
|
||||
require.Nil(t, nErr)
|
||||
th.App.ClearSessionCacheForUserSkipClusterSend(session.UserId)
|
||||
|
||||
_, err = th.App.GetSession(session.Token)
|
||||
@@ -121,8 +121,8 @@ func TestGetSessionIdleTimeoutInMinutes(t *testing.T) {
|
||||
|
||||
session, _ = th.App.CreateSession(session)
|
||||
time = session.LastActivityAt - (1000 * 60 * 6)
|
||||
err = th.App.Srv().Store.Session().UpdateLastActivityAt(session.Id, time)
|
||||
require.Nil(t, err)
|
||||
nErr = th.App.Srv().Store.Session().UpdateLastActivityAt(session.Id, time)
|
||||
require.Nil(t, nErr)
|
||||
th.App.ClearSessionCacheForUserSkipClusterSend(session.UserId)
|
||||
|
||||
_, err = th.App.GetSession(session.Token)
|
||||
@@ -343,8 +343,8 @@ func TestApp_ExtendExpiryIfNeeded(t *testing.T) {
|
||||
require.Equal(t, session.ExpiresAt, cachedSession.ExpiresAt)
|
||||
|
||||
// check database was updated.
|
||||
storedSession, err := th.App.Srv().Store.Session().Get(session.Token)
|
||||
require.Nil(t, err)
|
||||
storedSession, nErr := th.App.Srv().Store.Session().Get(session.Token)
|
||||
require.Nil(t, nErr)
|
||||
require.Equal(t, session.ExpiresAt, storedSession.ExpiresAt)
|
||||
})
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user