commit c65c792217b4478acb1c4c7dc03e7c74ddc50779
parent 176bfd62a796311187df17a74654a4d3f640243a
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Fri, 19 May 2023 19:21:40 -0700
optimize query
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/pkg/web/middlewares/middlewares.go b/pkg/web/middlewares/middlewares.go
@@ -268,8 +268,7 @@ func IsAuthMiddleware(next echo.HandlerFunc) echo.HandlerFunc {
c.Response().Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
- user.LastSeenAt = time.Now()
- user.DoSave(db)
+ db.DB().Model(user).Update("last_seen_at", time.Now())
// Prevent clickjacking by setting the header on every logged in page
if !strings.Contains(c.Path(), "/api/v1/chat/messages") &&