MCPcopy Create free account
hub / github.com/diffgram/diffgram / trigger_workflow

Function trigger_workflow

eventhandlers/SchedulerConsumer.py:17–31  ·  view source on GitHub ↗
(workflow_id: int, project_id: int)

Source from the content-addressed store, hash-verified

15logger = get_shared_logger()
16
17def trigger_workflow(workflow_id: int, project_id: int):
18 with session_scope_threaded() as session:
19 workflow = Workflow.get(session = session, workflow_id = workflow_id)
20 msg = {
21 'workflow_id': workflow_id,
22 'member_id': workflow.member_created_id,
23 'kind': 'time_trigger',
24 'project_id': project_id,
25 'action_id': None
26 }
27 queueclient = QueueClient()
28 logger.debug(f"Triggering Workflow {workflow_id}...")
29 queueclient.send_message(message = msg,
30 routing_key = RoutingKeys.action_trigger_event_new.value,
31 exchange = Exchanges.actions.value)
32
33class SchedulerConsumer:
34

Callers

nothing calls this directly

Calls 4

send_messageMethod · 0.95
session_scope_threadedFunction · 0.90
QueueClientClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected