Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timeout parameter to context.call #31

Merged
merged 5 commits into from
Dec 3, 2024
Merged

Conversation

CahidArda
Copy link
Collaborator

@CahidArda CahidArda commented Nov 26, 2024

Adds timeout parameter to context.call:

context.call("my-step", {
  url,
  body,
  headers: { "my-header": "my-value" },
  method: "PATCH",
  retries: retries,
  timeout: 30,
});

Also add an error when step name is undefined or empty string.

getHeaders method is becoming a little to crowded, but we are planning to refactor that in the future.

@@ -287,6 +287,7 @@ export class WorkflowContext<TInitialPayload = unknown> {
* @param body call body
* @param headers call headers
* @param retries number of call retries. 0 by default
* @param timeout max duration to wait for the endpoint to respond
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add the unit to jsdocs here?

@CahidArda CahidArda force-pushed the context-call-timeout-param branch from ba2f4a4 to 0bae923 Compare November 28, 2024 14:11
Copy link
Contributor

@joschan21 joschan21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make the error message a bit more clear, otherwise LGTM

src/context/steps.ts Outdated Show resolved Hide resolved
@CahidArda CahidArda merged commit f884e24 into main Dec 3, 2024
17 checks passed
@CahidArda CahidArda deleted the context-call-timeout-param branch December 3, 2024 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants