Quanlse/QTask.py
def _retryWhileNetworkError(func):
    """
    The decorator for retrying function when network failed
    """

    def _func(*args, **kwargs):
        retryCount = 0
        while retryCount < waitTaskRetrys:
            try:
                return func(*args, **kwargs)
            except Error.NetworkError:
                # retry if that's a network related error
                # other errors will be raised
                print(f"network error for {func.__name__}, retrying, {retryCount}")
                retryCount += 1
        else:
            return func(*args, **kwargs)

    return _func

    The decorator for retrying function when network failed
    
The decorator for retrying function when network failed
The decorator for retrying function when network failed
def _retryWhileNetworkError(func):
    def _func(*args, **kwargs):
        retryCount = 0
        while retryCount < waitTaskRetrys:
            try:
                return func(*args, **kwargs)
            except Error.NetworkError:
                print(f"network error for {func.__name__}, retrying, {retryCount}")
                retryCount += 1
        else:
            return func(*args, **kwargs)
    return _func
def _retryWhileNetworkError ( func ) : def _func ( * args , ** kwargs ) : retryCount = 0 while retryCount < waitTaskRetrys : try : return func ( * args , ** kwargs ) except Error . NetworkError : print ( f"network error for {func.__name__}, retrying, {retryCount}" ) retryCount += 1 else : return func ( * args , ** kwargs ) return _func
The decorator for retrying function when network failed
The decorator for retrying function when network failed
"""
    The decorator for retrying function when network failed
    """ # retry if that's a network related error # other errors will be raised
func