-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
It should be possible to re-try a request when a certain condition mets. This can be particularly useful when an action is performed asynchronously - like processing a video, in example.
A request retry could be triggered by a special function callable in the [Script] section. Also, there could be an option to define the maximum amount of retries.
GET https://{{.instance}}/processing/status
[Options]
max-retries = 20
[Script]
assert(response.StatusCode === 200);
if (response.Body.status === "processing" && retry(2000)) {
return;
}
assert(response.Body.Status === "finished");
The retry function could have the following signature.
function retry(in_ms?: number): boolean;in_ms defines a duration which is awaited before the next retry. The function returns a boolean which is true, when a next retry will occur. Otherwise, the function will return false, when no further retry will be scheduled. This can occur when max-retries has reached, in example.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request