chore: cleanup

This commit is contained in:
adamdottv
2025-05-13 06:51:28 -05:00
parent 0117c72a2c
commit 0c21ca5318
5 changed files with 79 additions and 27 deletions

View File

@@ -128,7 +128,7 @@ func (s *service) Update(ctx context.Context, message Message) (Message, error)
finishPart := message.FinishPart()
if finishPart != nil && finishPart.Time > 0 {
dbFinishedAt = sql.NullInt64{
Int64: finishPart.Time / 1000, // Convert Milliseconds from Go struct to Seconds for DB
Int64: finishPart.Time,
Valid: true,
}
}
@@ -193,11 +193,9 @@ func (s *service) ListAfter(ctx context.Context, sessionID string, timestampMill
s.mu.RLock()
defer s.mu.RUnlock()
timestampSeconds := timestampMillis / 1000 // Convert to seconds for DB query
dbMessages, err := s.db.ListMessagesBySessionAfter(ctx, db.ListMessagesBySessionAfterParams{
SessionID: sessionID,
CreatedAt: timestampSeconds,
CreatedAt: timestampMillis,
})
if err != nil {
return nil, fmt.Errorf("db.ListMessagesBySessionAfter: %w", err)