(ctx context.Context, record EventRecord)
| 3781 | } |
| 3782 | |
| 3783 | func (m *Service) notifyTaskObserverBestEffort(ctx context.Context, record EventRecord) { |
| 3784 | if m == nil || m.eventObserver == nil { |
| 3785 | return |
| 3786 | } |
| 3787 | |
| 3788 | defer func() { |
| 3789 | if recovered := recover(); recovered != nil { |
| 3790 | slog.Error( |
| 3791 | "task: task event observer panicked during post-commit notification", |
| 3792 | "panic", recovered, |
| 3793 | "event_id", record.Event.ID, |
| 3794 | "task_id", record.Event.TaskID, |
| 3795 | "run_id", record.Event.RunID, |
| 3796 | "event_type", record.Event.EventType, |
| 3797 | ) |
| 3798 | } |
| 3799 | }() |
| 3800 | |
| 3801 | m.eventObserver.OnTaskEvent(ctx, record) |
| 3802 | } |
| 3803 | |
| 3804 | func marshalTaskEventPayload(payload any) (json.RawMessage, error) { |
| 3805 | if payload == nil { |
no test coverage detected