feat(backend): fixed no sessID in storage service
This commit is contained in:
parent
51a6d87e68
commit
36b6dfb5bd
4 changed files with 5 additions and 4 deletions
|
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
|
@ -55,7 +56,7 @@ func main() {
|
|||
}
|
||||
msg.Meta().SetMeta(oldMeta)
|
||||
}
|
||||
sessCtx := context.WithValue(context.Background(), "sessionID", msg.SessionID())
|
||||
sessCtx := context.WithValue(context.Background(), "sessionID", fmt.Sprintf("%d", msg.SessionID()))
|
||||
// Process session to save mob files to s3
|
||||
sesEnd := msg.(*messages.SessionEnd)
|
||||
if err := srv.Process(sessCtx, sesEnd); err != nil {
|
||||
|
|
|
|||
|
|
@ -2089,5 +2089,5 @@ func ReadMessage(t uint64, reader BytesReader) (Message, error) {
|
|||
case 111:
|
||||
return DecodeIOSIssueEvent(reader)
|
||||
}
|
||||
return nil, fmt.Errorf("Unknown message code: %v", t)
|
||||
return nil, fmt.Errorf("unknown message code: %v", t)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ func (s *sessionFinderImpl) worker() {
|
|||
func (s *sessionFinderImpl) findSession(sessionID, timestamp, partition uint64) {
|
||||
sessEnd := &messages.SessionEnd{Timestamp: timestamp}
|
||||
sessEnd.SetSessionID(sessionID)
|
||||
ctx := context.WithValue(context.Background(), "sessionID", sessionID)
|
||||
ctx := context.WithValue(context.Background(), "sessionID", fmt.Sprintf("%d", sessionID))
|
||||
err := s.storage.Process(ctx, sessEnd)
|
||||
if err == nil {
|
||||
s.log.Info(ctx, "found session in partition: %d, original: %d",
|
||||
|
|
|
|||
|
|
@ -20,5 +20,5 @@ func ReadMessage(t uint64, reader BytesReader) (Message, error) {
|
|||
case <%= msg.id %>:
|
||||
return Decode<%= msg.name %>(reader)<% end %>
|
||||
}
|
||||
return nil, fmt.Errorf("Unknown message code: %v", t)
|
||||
return nil, fmt.Errorf("unknown message code: %v", t)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue