Skip to content

Commit

Permalink
[core] Rename busEvent in task.go
Browse files Browse the repository at this point in the history
  • Loading branch information
teo committed Mar 8, 2024
1 parent a4356b6 commit 6ea2809
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/task/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ func (t *Task) SendEvent(ev event.Event) {
t.mu.RLock()
defer t.mu.RUnlock()

busEvent := &evpb.Ev_TaskEvent{
outgoingEvent := &evpb.Ev_TaskEvent{
Name: t.name,
Taskid: t.taskId,
State: t.state.String(),
Expand All @@ -509,18 +509,18 @@ func (t *Task) SendEvent(ev event.Event) {
}

if t.parent == nil {
the.EventWriterWithTopic(topic.Task).WriteEvent(busEvent)
the.EventWriterWithTopic(topic.Task).WriteEvent(outgoingEvent)
return
}

busEvent.Envid = t.parent.GetEnvironmentId().String()
outgoingEvent.Envid = t.parent.GetEnvironmentId().String()

taskEvent, ok := ev.(*event.TaskEvent)
if ok {
busEvent.State = taskEvent.State
busEvent.Status = taskEvent.Status
outgoingEvent.State = taskEvent.State
outgoingEvent.Status = taskEvent.Status
}
the.EventWriterWithTopic(topic.Task).WriteEvent(busEvent)
the.EventWriterWithTopic(topic.Task).WriteEvent(outgoingEvent)

t.parent.SendEvent(ev)
}
Expand Down

0 comments on commit 6ea2809

Please sign in to comment.