EyeAuras Docs EyeAuras Docs
EyeAuras Docs EyeAuras Docs
DocFX + Singulink = ♥

Search Results for

    Property MaximumExecutionTime

    MaximumExecutionTime

    Gets or sets the maximum amount of time allowed for the script execution. If the execution time exceeds this limit, the script will be forcefully terminated by cancelling the CancellationToken passed to the script.

    Declaration
    TimeSpan MaximumExecutionTime { get; set; }
    Property Value
    Type Description
    TimeSpan
    Remarks

    The script needs to periodically check the cancellation token to respond to cancellation requests. Scripts that do not check IsCancellationRequested may continue to run beyond the specified maximum execution time.

    For a script that supports graceful cancellation:

    while (!cancellationToken.IsCancellationRequested)
    {
        // Perform work here
    }

    A script ignoring the cancellation token will not be stopped automatically:

    while (true)
    {
        // Infinite loop, does not check cancellationToken
    }

    It's crucial for scripts to implement proper cancellation checks to ensure they can be terminated gracefully.

    © Xab3r. All rights reserved.