Skip to content

Default HttpMultipartRestClient timeout is overridden by constructors #2

@srstsavage

Description

@srstsavage

HttpMultipartRestClient contains a default timeout parameter (DEFAULT_TIMEOUT_PARAM = "D1Client.http.default.timeouts.ms") which is used if a more specific timeout is not set. However, this parameter is not user settable because HttpMultipartRestClient's constructors call setDefaultTimeout(DEFAULT_TIMEOUT_VALUE);, which overwrites the parameter in the configuration in the Settings singleton.

A better approach might be to check if D1Client.http.default.timeouts.ms is set in a static block in HttpMultipartRestClient, and set it to DEFAULT_TIMEOUT_VALUE if not. Something like (untested):

static {
  if (!Settings.getConfiguration().containsKey(DEFAULT_TIMEOUT_PARAM)) {
    Settings.getConfiguration().setProperty(DEFAULT_TIMEOUT_PARAM, DEFAULT_TIMEOUT_VALUE);
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions