tasks/libs/pipeline_tools.py
def loop_status(callable, timeout_sec):
    """
    Utility to loop a function that takes a status and returns [done, status], until done is True.
    """
    start = time()
    status = dict()
    while True:
        done, status = callable(status)
        if done:
            return status
        if time() - start > timeout_sec:
            raise ErrorMsg("Timed out.")
        sleep(10)

    Utility to loop a function that takes a status and returns [done, status], until done is True.
    
Utility to loop a function that takes a status and returns [done, status], until done is True.
Utility to loop a function that takes a status and returns [ done status ] until done is True .
def loop_status(callable, timeout_sec):
    start = time()
    status = dict()
    while True:
        done, status = callable(status)
        if done:
            return status
        if time() - start > timeout_sec:
            raise ErrorMsg("Timed out.")
        sleep(10)
def loop_status ( callable , timeout_sec ) : start = time ( ) status = dict ( ) while True : done , status = callable ( status ) if done : return status if time ( ) - start > timeout_sec : raise ErrorMsg ( "Timed out." ) sleep ( 10 )
Utility to loop a function that takes a status and returns [done, status], until done is True.
Utility to loop a function that takes a status and returns [ done status ] until done is True .
"""
    Utility to loop a function that takes a status and returns [done, status], until done is True.
    """
callable
timeout_sec