Skip to content

Add timeout configuration #346

@tdstein

Description

@tdstein

Overview

Add support for configuring the timeout parameter via the command line and as an environment variable.

Background

The current implementation uses a hardcoded timeout in 9 locations throughout the application. Each reference is within one of the following files. These references can also be found using the following regex search: timeout.*=\d+[,|)]

Multiple customers have requested support for configurable timeouts to support nuances of their environment.

See issues:

Proposal

Define a new timeout option in the CLI interface that is optional. When not supplied by the user, the value will fall back to a method call. The method call will obtain a timeout value from an environment variable.

For example:

def get_timeout() -> int:
    return int(os.environ.get("TIMEOUT", "60"))

@click.option(
    "--timeout", prompt=True,
    default=lambda: get_timeout()
)

Then, refactor uses of timeout throughout the application to use the get_timeout method by default. And refactor calls that use a timeout to pass the value down from the CLI option. In other words, refactor the application to use the CLI timeout parameter when invoked via the CLI interface. Otherwise, use the get_timeout method by default when invoked via the Python API.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions