@@ -26,6 +26,7 @@ package callable
2626
2727import (
2828 "fmt"
29+ "strconv"
2930 texttemplate "text/template"
3031 "time"
3132
@@ -129,6 +130,13 @@ func (c *Call) Call() error {
129130 template .WrapPointer (& returnVar ),
130131 }
131132 c .VarStack ["environment_id" ] = c .parentRole .GetEnvironmentId ().String ()
133+ c .VarStack ["__call_func" ] = c .Func
134+ c .VarStack ["__call_timeout" ] = c .Traits .Timeout
135+ c .VarStack ["__call_trigger" ] = c .Traits .Trigger
136+ c .VarStack ["__call_await" ] = c .Traits .Await
137+ c .VarStack ["__call_critical" ] = strconv .FormatBool (c .Traits .Critical )
138+ c .VarStack ["__call_rolepath" ] = c .GetParentRolePath ()
139+
132140 objStack := integration .PluginsInstance ().ObjectStack (c )
133141
134142 err := fields .Execute (apricot .Instance (), c .GetName (), c .VarStack , objStack , make (map [string ]texttemplate.Template ))
@@ -144,7 +152,7 @@ func (c *Call) Call() error {
144152func (c * Call ) Start () {
145153 c .await = make (chan error )
146154 go func () {
147- callId := fmt .Sprintf ("hook:%s" , c .GetName ())
155+ callId := fmt .Sprintf ("hook:%s:%s" , c . GetTraits (). Trigger , c .GetName ())
148156 log .Debugf ("%s started" , callId )
149157 defer utils .TimeTrack (time .Now (), callId , log .WithPrefix ("callable" ))
150158 c .await <- c .Call ()
0 commit comments