Log slow API requests with server spans and client timing

This commit is contained in:
Ian Gulliver
2026-10-21 14:45:19 -07:00
parent 671165ec71
commit b4c1dbab37
31 changed files with 458 additions and 185 deletions
+2 -2
View File
@@ -161,7 +161,7 @@ func (m *Manager) ask(ctx context.Context, l *live, raw json.RawMessage) (string
if err != nil {
return "", err
}
behind, err := git.Behind(task.WorktreePath, project.DefaultBranch)
behind, err := git.Behind(ctx, task.WorktreePath, project.DefaultBranch)
if err != nil {
slog.Error("count commits behind default branch", "task", task.Id, "err", err)
}
@@ -182,7 +182,7 @@ func (m *Manager) ask(ctx context.Context, l *live, raw json.RawMessage) (string
func (m *Manager) commitBeforeSync(ctx context.Context, l *live, branch string) error {
unlock := m.lockTask(l.taskID)
defer unlock()
_, err := git.CommitAll(l.dir, "Work before merging "+branch, l.gitName, l.gitEmail)
_, err := git.CommitAll(ctx, l.dir, "Work before merging "+branch, l.gitName, l.gitEmail)
if err != nil {
return err
}