We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c996381 commit 56edb77Copy full SHA for 56edb77
1 file changed
core/task/task.go
@@ -251,6 +251,16 @@ func (t *Task) GetTraits() Traits {
251
return Traits{}
252
}
253
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
+
264
// Returns a consolidated CommandInfo for this Task, based on Roles tree and
265
// Class.
266
func (t *Task) BuildTaskCommand(role parentRole) (err error) {
@@ -525,7 +535,7 @@ func (t *Task) SendEvent(ev event.Event) {
525
535
Hostname: t.hostname,
526
536
ClassName: t.className,
527
537
Path: t.getParentRolePath(),
528
- Traits: traitsToPbTraits(t.GetTraits()),
538
+ Traits: traitsToPbTraits(t.getTraits()),
529
539
530
540
531
541
if t.parent == nil {
0 commit comments