Something went wrong. Try again.
prefect server in zig
Something went wrong. Try again.
123456789101112131415161718192021222324"""Shared task definition for test-background-tasks.
Imported by both the test runner (which calls .delay()) and the workersubprocess (which calls .serve()). Living in its own module ensures bothprocesses compute the same `task_key` — task_key includes a hash of thefunction's code object, and __main__-defined tasks can hash differentlydepending on entrypoint (uv-script header vs direct `python <file>`)."""
from prefect import taskfrom prefect.cache_policies import NONE
# `cache_policy=NONE` disables caching so the test exercises a fresh# server-side state transition path on every invocation. Without it,# subsequent runs with the same (a, b) hit a local result-store cache# and skip the COMPLETED transition we want to observe.@task( cache_policy=NONE, persist_result=True,)def add(a: int, b: int) -> int: return a + b