File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -251,6 +251,16 @@ func (t *Task) GetTraits() Traits {
251251 return Traits {}
252252}
253253
254+ // lock-free version of GetTraits
255+ func (t * Task ) getTraits () Traits {
256+ if class := t .GetTaskClass (); class != nil {
257+ if t .parent != nil {
258+ return t .parent .GetTaskTraits ()
259+ }
260+ }
261+ return Traits {}
262+ }
263+
254264// Returns a consolidated CommandInfo for this Task, based on Roles tree and
255265// Class.
256266func (t * Task ) BuildTaskCommand (role parentRole ) (err error ) {
@@ -525,7 +535,7 @@ func (t *Task) SendEvent(ev event.Event) {
525535 Hostname : t .hostname ,
526536 ClassName : t .className ,
527537 Path : t .getParentRolePath (),
528- Traits : traitsToPbTraits (t .GetTraits ()),
538+ Traits : traitsToPbTraits (t .getTraits ()),
529539 }
530540
531541 if t .parent == nil {
You can’t perform that action at this time.
0 commit comments