Hello, I am looking to change the default timeout ...
# singer-tap-development
n
Hello, I am looking to change the default timeout for my custom tap, but not sure where to do this. Could someone please provide an example. I see the default is 300 and the documentation states to use
DEFAULT_REQUEST_TIMEOUT
to override, but again not sure where in the code I should set this. Thanks!
r
The default timeout is 300 seconds, or as defined by DEFAULT_REQUEST_TIMEOUT.
DEFAULT_REQUEST_TIMEOUT
is a constant defined in the SDK source. To override the default timeout inherited from
RESTStream
, you need to supply the
timeout
property in your stream class (can be done in 2 different ways):
client.py
Copy code
class CustomStream(RESTStream):

    # static override of 3 minutes (180s)
    timeout = 180

    # dynamic override from config `timeout` value, or fallback to SDK default from `RESTStream`
    @property
    def timeout(self) -> int:
        return self.config.get("timeout", super().timeout)
n
thank you!