feat: logging from step run executions (#217)

* fix: job cancellations with shared ctx

* fix: found the bug

* fix: all job runs were getting cancelled

* feat: support logging from executions

* fix: place logging in background

* add back split screen
This commit is contained in:
abelanger5
2024-03-01 14:55:31 -08:00
committed by GitHub
parent f5a6e80fc7
commit f256b258d8
54 changed files with 2299 additions and 271 deletions

View File

@@ -0,0 +1,25 @@
import time
from hatchet_sdk import Hatchet, Context
from dotenv import load_dotenv
load_dotenv()
hatchet = Hatchet()
@hatchet.workflow(on_events=["user:create"],schedule_timeout="10m")
class LoggingWorkflow:
@hatchet.step()
def logger(self, context : Context):
for i in range(1000):
context.log(f"Logging message {i}")
return {
"step1": "completed",
}
workflow = LoggingWorkflow()
worker = hatchet.worker('logging-worker-py')
worker.register_workflow(workflow)
worker.start()