Skip to content

The only tool you need to know what is happening and how to fix it.

bug: duration insert fix

ddux4fe42e6d365e
diff --git a/backend/app/repositories/endpoint.repository.go b/backend/app/repositories/endpoint.repository.go
index 7c536fe4..93a3874c 100644
--- a/backend/app/repositories/endpoint.repository.go
+++ b/backend/app/repositories/endpoint.repository.go
@@ -27,7 +27,7 @@ func (e *endpointRepository) InsertAsync(ctx context.Context, lines []models.End
attributesJSON = string(attributesBytes)
}
}
- if err := batch.Append(t.Id, t.ProjectId, t.Endpoint, t.Duration, t.RecordedAt, t.StatusCode, t.BodySize, t.ClientIP, attributesJSON, t.AppVersion, t.ServerName); err != nil {
+ if err := batch.Append(t.Id, t.ProjectId, t.Endpoint, int64(t.Duration), t.RecordedAt, t.StatusCode, t.BodySize, t.ClientIP, attributesJSON, t.AppVersion, t.ServerName); err != nil {
return err
}
}
diff --git a/backend/app/repositories/span.repository.go b/backend/app/repositories/span.repository.go
index f2c62d45..9f6601e3 100644
--- a/backend/app/repositories/span.repository.go
+++ b/backend/app/repositories/span.repository.go
@@ -29,7 +29,7 @@ func (r *spanRepository) InsertAsync(ctx context.Context, spans []models.Span) e
s.ProjectId,
s.Name,
s.StartTime,
- s.Duration,
+ int64(s.Duration),
s.RecordedAt,
); err != nil {
return err
diff --git a/backend/app/repositories/task.repository.go b/backend/app/repositories/task.repository.go
index 9226bee7..73840151 100644
--- a/backend/app/repositories/task.repository.go
+++ b/backend/app/repositories/task.repository.go
@@ -27,7 +27,7 @@ func (e *taskRepository) InsertAsync(ctx context.Context, lines []models.Task) e
attributesJSON = string(attributesBytes)
}
}
- if err := batch.Append(t.Id, t.ProjectId, t.TaskName, t.Duration, t.RecordedAt, t.ClientIP, attributesJSON, t.AppVersion, t.ServerName); err != nil {
+ if err := batch.Append(t.Id, t.ProjectId, t.TaskName, int64(t.Duration), t.RecordedAt, t.ClientIP, attributesJSON, t.AppVersion, t.ServerName); err != nil {
return err
}
}