MCPcopy Create free account
hub / github.com/StackStorm/st2 / _emit_trigger_instance

Method _emit_trigger_instance

st2reactor/st2reactor/timer/base.py:155–173  ·  view source on GitHub ↗
(self, trigger)

Source from the content-addressed store, hash-verified

153 )
154
155 def _emit_trigger_instance(self, trigger):
156 utc_now = date_utils.get_datetime_utc_now()
157 # debug logging is reasonable for this one. A high resolution timer will end up
158 # trashing standard logs.
159 LOG.debug("Timer fired at: %s. Trigger: %s", str(utc_now), trigger)
160
161 payload = {
162 "executed_at": str(utc_now),
163 "schedule": trigger["parameters"].get("time"),
164 }
165
166 trace_context = TraceContext(
167 trace_tag="%s-%s"
168 % (
169 self._get_trigger_type_name(trigger),
170 trigger.get("name", uuid.uuid4().hex),
171 )
172 )
173 self._trigger_dispatcher.dispatch(trigger, payload, trace_context=trace_context)
174
175 def _get_trigger_type_name(self, trigger):
176 trigger_type_ref = trigger["type"]

Callers 1

Calls 4

TraceContextClass · 0.90
getMethod · 0.45
dispatchMethod · 0.45

Tested by 1