Thread
#prefect-community
    Stephen Herron

    Stephen Herron

    6 months ago
    hi, if I wanted a task to loop or retry by raising a signal, how would I delay the next iteration of the retry? I’m basically create a task that polls something and I’d might want to check that every 10 minutes or so. Previously, I had a for loop/sleep in the task but I figured this signalling would be a better way?
    Kevin Kho

    Kevin Kho

    6 months ago
    Hi @Stephen Herron, time.sleep works or you can use the
    max_retries
    and
    retry_delay
    Stephen Herron

    Stephen Herron

    6 months ago
    yes I think i’m missing something though if say the task decorator has
    max_retries
    and
    retry_delay
    specified.. and you raise the
    RETRY
    signal inside the task, should it not respect the settings in the decorator? might be confusing context/purpose
    Kevin Kho

    Kevin Kho

    6 months ago
    If it doesn’t you can
    raise FAIL
    too.
    Stephen Herron

    Stephen Herron

    6 months ago
    that works