🔊 Verbose logging at setting last seen at

This commit is contained in:
LittleSheep 2024-12-03 21:24:16 +08:00
parent 87c3b81ad4
commit 3074cd93d8
2 changed files with 7 additions and 5 deletions

8
.idea/workspace.xml generated
View File

@ -4,9 +4,9 @@
<option name="autoReloadType" value="ALL" /> <option name="autoReloadType" value="ALL" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":boom: Pagination fetching realm member api&#10;:bug: Fix remove realm member has no memberId path param"> <list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":bug: Fix check user exists in realm bug">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/internal/services/realms.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/services/realms.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/pkg/internal/grpc/stream.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/grpc/stream.go" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -159,7 +159,6 @@
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" /> <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
<MESSAGE value=":sparkles: Allow get realm by numeric auto increment id" />
<MESSAGE value=":sparkles: Allow access user info via numeric id" /> <MESSAGE value=":sparkles: Allow access user info via numeric id" />
<MESSAGE value=":bug: Fix get user info query statement bug" /> <MESSAGE value=":bug: Fix get user info query statement bug" />
<MESSAGE value=":boom: Remove deprecated subscription API" /> <MESSAGE value=":boom: Remove deprecated subscription API" />
@ -184,7 +183,8 @@
<MESSAGE value=":sparkles: Add realm member support both account name and id" /> <MESSAGE value=":sparkles: Add realm member support both account name and id" />
<MESSAGE value=":bug: Prevent user adding a user twice into a realm" /> <MESSAGE value=":bug: Prevent user adding a user twice into a realm" />
<MESSAGE value=":boom: Pagination fetching realm member api&#10;:bug: Fix remove realm member has no memberId path param" /> <MESSAGE value=":boom: Pagination fetching realm member api&#10;:bug: Fix remove realm member has no memberId path param" />
<option name="LAST_COMMIT_MESSAGE" value=":boom: Pagination fetching realm member api&#10;:bug: Fix remove realm member has no memberId path param" /> <MESSAGE value=":bug: Fix check user exists in realm bug" />
<option name="LAST_COMMIT_MESSAGE" value=":bug: Fix check user exists in realm bug" />
<option name="GROUP_MULTIFILE_MERGE_BY_DIRECTORY" value="true" /> <option name="GROUP_MULTIFILE_MERGE_BY_DIRECTORY" value="true" />
</component> </component>
<component name="VgoProject"> <component name="VgoProject">

View File

@ -5,6 +5,7 @@ import (
"git.solsynth.dev/hypernet/nexus/pkg/nex" "git.solsynth.dev/hypernet/nexus/pkg/nex"
"git.solsynth.dev/hypernet/nexus/pkg/proto" "git.solsynth.dev/hypernet/nexus/pkg/proto"
"git.solsynth.dev/hypernet/passport/pkg/internal/services" "git.solsynth.dev/hypernet/passport/pkg/internal/services"
"github.com/rs/zerolog/log"
) )
func (v *App) BroadcastEvent(ctx context.Context, request *proto.EventInfo) (*proto.EventResponse, error) { func (v *App) BroadcastEvent(ctx context.Context, request *proto.EventInfo) (*proto.EventResponse, error) {
@ -16,7 +17,8 @@ func (v *App) BroadcastEvent(ctx context.Context, request *proto.EventInfo) (*pr
case "ws.client.unregister": case "ws.client.unregister":
// Update user last seen at // Update user last seen at
data := nex.DecodeMap(request.GetData()) data := nex.DecodeMap(request.GetData())
_ = services.SetAccountLastSeen(uint(data["user"].(float64))) err := services.SetAccountLastSeen(uint(data["user"].(float64)))
log.Debug().Err(err).Any("event", data).Msg("Setting account last seen...")
} }
return &proto.EventResponse{}, nil return &proto.EventResponse{}, nil