Deceivious
03/24/2023, 2:29 PMfrom datetime import timedelta
from prefect import flow, task
from prefect.filesystems import LocalFileSystem
from prefect.serializers import JSONSerializer
from prefect.tasks import task_input_hash
@flow(name="sdfsdf")
def main():
tas1()
@task(
name="1",
cache_key_fn=task_input_hash,
cache_expiration=timedelta(minutes=5),
persist_result=True,
result_storage=LocalFileSystem(base_path=".strage-Temp"),
result_serializer=JSONSerializer(jsonlib="json"),
)
def tas1():
raise 1 / 0
if __name__ == "__main__":
main()
Zanie
03/24/2023, 2:39 PMDeceivious
03/24/2023, 4:23 PMZanie
03/24/2023, 4:32 PM