mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
chore: decrease frequency of updating last_seen (#88461)
This commit is contained in:
@@ -309,7 +309,7 @@ func (s *Service) UpdateLastSeenAt(ctx context.Context, cmd *user.UpdateUserLast
|
||||
}
|
||||
|
||||
func shouldUpdateLastSeen(t time.Time) bool {
|
||||
return time.Since(t) > time.Minute*5
|
||||
return time.Since(t) > time.Minute*15
|
||||
}
|
||||
|
||||
func (s *Service) GetSignedInUser(ctx context.Context, query *user.GetSignedInUserQuery) (*user.SignedInUser, error) {
|
||||
|
||||
@@ -223,7 +223,7 @@ func TestUpdateLastSeenAt(t *testing.T) {
|
||||
userService.cfg = setting.NewCfg()
|
||||
|
||||
t.Run("update last seen at", func(t *testing.T) {
|
||||
userStore.ExpectedSignedInUser = &user.SignedInUser{UserID: 1, OrgID: 1, Email: "email", Login: "login", Name: "name", LastSeenAt: time.Now().Add(-10 * time.Minute)}
|
||||
userStore.ExpectedSignedInUser = &user.SignedInUser{UserID: 1, OrgID: 1, Email: "email", Login: "login", Name: "name", LastSeenAt: time.Now().Add(-20 * time.Minute)}
|
||||
err := userService.UpdateLastSeenAt(context.Background(), &user.UpdateUserLastSeenAtCommand{UserID: 1, OrgID: 1})
|
||||
require.NoError(t, err)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user