Update templates/workflow_template.py.j2
This commit is contained in:
parent
c991553d5c
commit
0c5e26c1b9
@ -16,7 +16,6 @@ logger = logging.getLogger(__name__)
|
|||||||
class {{ workflow_class_name }}:
|
class {{ workflow_class_name }}:
|
||||||
@temporalio.workflow.run
|
@temporalio.workflow.run
|
||||||
async def run(self, root_inputs: Dict[str, Any]) -> Dict[str, Any]:
|
async def run(self, root_inputs: Dict[str, Any]) -> Dict[str, Any]:
|
||||||
await temporalio.workflow.sleep(0)
|
|
||||||
workflow_info = temporalio.workflow.info()
|
workflow_info = temporalio.workflow.info()
|
||||||
workflow_output: Dict[str, Any] = {
|
workflow_output: Dict[str, Any] = {
|
||||||
"workflow_id": workflow_info.workflow_id,
|
"workflow_id": workflow_info.workflow_id,
|
||||||
@ -137,7 +136,6 @@ class {{ workflow_class_name }}:
|
|||||||
if isinstance(result, Exception):
|
if isinstance(result, Exception):
|
||||||
logger.error(f"Task failed with exception: {result}")
|
logger.error(f"Task failed with exception: {result}")
|
||||||
workflow_output["status"] = "failed"
|
workflow_output["status"] = "failed"
|
||||||
await temporalio.workflow.sleep(0)
|
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
# Update workflow status to completed if not failed
|
# Update workflow status to completed if not failed
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user