j

    James Watt

    3 years ago
    Hello, how can I get the currently running task's retry attempt? Is it possible to get the elapsed time of the retry delay during the run time as well? Thanks in advance.
    Chris White

    Chris White

    3 years ago
    You can get the retry count by accessing prefect.context.get("task_run_count", 1); for “the elapsed time of the retry delay”, you might be able to infer that from one of the datetime objects that are also present in context (more info on that here: https://docs.prefect.io/api/unreleased/utilities/context.html)
    j

    James Watt

    3 years ago
    Thank you, Chris. That really helps.👍
    Chris White

    Chris White

    3 years ago
    Anytime!