Skip to content

Commit

Permalink
[core] added internal non mutexed method getParentRolePath to task.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Tichák authored and teo committed May 6, 2024
1 parent 7d06fd5 commit 8a9460c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions core/task/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,19 @@ func (t *Task) GetParentRole() interface{} {
return t.parent
}

func (t *Task) GetParentRolePath() string {
t.mu.RLock()
defer t.mu.RUnlock()
func (t *Task) getParentRolePath() string {
if t.parent == nil {
return ""
}
return t.parent.GetPath()
}

func (t *Task) GetParentRolePath() string {
t.mu.RLock()
defer t.mu.RUnlock()
return t.getParentRolePath()
}

func (t *Task) IsLocked() bool {
t.mu.RLock()
defer t.mu.RUnlock()
Expand Down Expand Up @@ -509,7 +513,7 @@ func (t *Task) SendEvent(ev event.Event) {
Status: t.status.String(),
Hostname: t.hostname,
ClassName: t.className,
Path: t.GetParentRolePath(),
Path: t.getParentRolePath(),
}

if t.parent == nil {
Expand Down

0 comments on commit 8a9460c

Please sign in to comment.