Saulius Beinorius

    Saulius Beinorius

    1 year ago
    Hi, is there a way to have task timeouts - to mark the task as failed if it runs too long (and then execute some code to stop it, for example)? In my case I can code that into the task itself, but it would be nice if there was some built-in mechanism.
    nicholas

    nicholas

    1 year ago
    Hi @Saulius Beinorius - the task constructor takes a kwarg
    timeout
    , to which you can pass a number (in seconds) to wait before timing out the task. For more information on the
    timeout
    kwarg and other task kwargs, take a look at the Task API.
    Saulius Beinorius

    Saulius Beinorius

    1 year ago
    Thanks! And if I see correctly, the
    on_failure
    parameter answer the second part of my question 🙂
    nicholas

    nicholas

    1 year ago
    Ah yes sorry! I missed the question in the parenthesis 🙂
    Saulius Beinorius

    Saulius Beinorius

    1 year ago
    No problem, thanks for the help!