From 342794fb5122bcda6d0b94bc4d5e6764cd4227b8 Mon Sep 17 00:00:00 2001 From: Joel Rebello Date: Tue, 2 May 2023 10:10:38 +0200 Subject: [PATCH] purge unused StreamEvent.Data field --- internal/model/task.go | 9 ++------- internal/worker/worker.go | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/internal/model/task.go b/internal/model/task.go index edf95f7f..0c4e105c 100644 --- a/internal/model/task.go +++ b/internal/model/task.go @@ -7,7 +7,6 @@ import ( "github.com/google/uuid" cptypes "github.com/metal-toolbox/conditionorc/pkg/types" "go.hollow.sh/toolbox/events" - "go.infratographer.com/x/pubsubx" "go.infratographer.com/x/urnx" ) @@ -140,15 +139,11 @@ type Task struct { // StreamEvent holds properties of a message received on the stream. type StreamEvent struct { - // Msg is the original message that created this task. + // Msg is the original event that created this task. // This is here so that the events subsystem can be acked/notified as the task makes progress. Msg events.Message - // Data is the data parsed from Msg for the task runner. - Data *pubsubx.Message - - // Condition defines the kind of work to be performed, - // its parsed from the message. + // Condition defines the kind of work to be performed, its parsed from Data. Condition *cptypes.Condition // Urn is the URN parsed from Msg for the task runner. diff --git a/internal/worker/worker.go b/internal/worker/worker.go index ceac2daa..6277feab 100644 --- a/internal/worker/worker.go +++ b/internal/worker/worker.go @@ -273,7 +273,6 @@ func (o *Worker) processEvent(ctx context.Context, e events.Message) { streamEvent := &model.StreamEvent{ Msg: e, - Data: data, Condition: condition, Urn: urn, }