summaryrefslogtreecommitdiffhomepage
path: root/internal/logging/logging.go
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-05-12 10:45:03 -0500
committeradamdottv <[email protected]>2025-05-12 10:45:03 -0500
commit8cbfc581b5243aece96d32fc97c72ada5df3ae54 (patch)
treef7a6c45d6ea3f767526e37f0104f020da9481ffe /internal/logging/logging.go
parent4bb350a09ba5c88a830f4ab07fcc99b4febda0dc (diff)
downloadopencode-8cbfc581b5243aece96d32fc97c72ada5df3ae54.tar.gz
opencode-8cbfc581b5243aece96d32fc97c72ada5df3ae54.zip
chore: cleanup
Diffstat (limited to 'internal/logging/logging.go')
-rw-r--r--internal/logging/logging.go11
1 files changed, 0 insertions, 11 deletions
diff --git a/internal/logging/logging.go b/internal/logging/logging.go
index 0ef5f0f28..850fd85d6 100644
--- a/internal/logging/logging.go
+++ b/internal/logging/logging.go
@@ -11,7 +11,6 @@ import (
"os"
"runtime/debug"
"strings"
- "sync"
"time"
"github.com/go-logfmt/logfmt"
@@ -45,7 +44,6 @@ type Service interface {
type service struct {
db *db.Queries
broker *pubsub.Broker[Log]
- mu sync.RWMutex
}
var globalLoggingService *service
@@ -72,9 +70,6 @@ func GetService() Service {
}
func (s *service) Create(ctx context.Context, log Log) error {
- s.mu.Lock()
- defer s.mu.Unlock()
-
if log.ID == "" {
log.ID = uuid.New().String()
}
@@ -115,9 +110,6 @@ func (s *service) Create(ctx context.Context, log Log) error {
}
func (s *service) ListBySession(ctx context.Context, sessionID string) ([]Log, error) {
- s.mu.RLock()
- defer s.mu.RUnlock()
-
dbLogs, err := s.db.ListLogsBySession(ctx, sql.NullString{String: sessionID, Valid: true})
if err != nil {
return nil, fmt.Errorf("db.ListLogsBySession: %w", err)
@@ -126,9 +118,6 @@ func (s *service) ListBySession(ctx context.Context, sessionID string) ([]Log, e
}
func (s *service) ListAll(ctx context.Context, limit int) ([]Log, error) {
- s.mu.RLock()
- defer s.mu.RUnlock()
-
dbLogs, err := s.db.ListAllLogs(ctx, int64(limit))
if err != nil {
return nil, fmt.Errorf("db.ListAllLogs: %w", err)