Skip to content

Commit

Permalink
Fix read timeout with cloud function (#2801)
Browse files Browse the repository at this point in the history
* fix(rest): Fix Timeout with cloud function

* fix(rest): Fix Timeout with cloud function

* fix(rest): Add constant
  • Loading branch information
johnBgood authored Jun 26, 2024
1 parent e144f02 commit 7b1e429
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class CloudFunctionService {

private static final Logger LOG = LoggerFactory.getLogger(CloudFunctionService.class);
private static final String PROXY_FUNCTION_URL_ENV_NAME = "CAMUNDA_CONNECTOR_HTTP_PROXY_URL";
private static final int NO_TIMEOUT = 0;
private final String proxyFunctionUrl = System.getenv(PROXY_FUNCTION_URL_ENV_NAME);
private final CloudFunctionCredentials credentials;

Expand Down Expand Up @@ -107,6 +108,7 @@ private HttpCommonRequest createCloudFunctionRequest(String contentAsJson, Strin
cloudFunctionRequest.setMethod(HttpMethod.POST);
cloudFunctionRequest.setUrl(getProxyFunctionUrl());
cloudFunctionRequest.setBody(contentAsJson);
cloudFunctionRequest.setReadTimeoutInSeconds(NO_TIMEOUT);
cloudFunctionRequest.setHeaders(
Map.of(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.getMimeType()));
cloudFunctionRequest.setAuthentication(new BearerAuthentication(token));
Expand Down

0 comments on commit 7b1e429

Please sign in to comment.