Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Fix: waitProjectStart handle async request #229

Merged
merged 4 commits into from
Apr 14, 2023

Conversation

gciavarrini
Copy link
Contributor

@gciavarrini gciavarrini commented Apr 12, 2023

Improve async handling of response and retry mechanism.

AsyncResult<T> is a generic class to be used also in future PRs (e.g. for Complex Flow implementation)

Depends on PR #230

@pkliczewski
Copy link
Collaborator

@gciavarrini please rebase on top of #230

Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Copy link
Collaborator

@pkliczewski pkliczewski left a comment

Choose a reason for hiding this comment

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

/lgtm

ApiCallback<List<ProjectResponseDTO>> apiCallback = new ApiCallback<>() {
AtomicInteger failureCounter = new AtomicInteger(0);

@Override
public void onFailure(ApiException e, int statusCode, Map<String, List<String>> responseHeaders) {
int i = failureCounter.incrementAndGet();
if (i >= 100) {
retry.set(false);
asyncResult.setError(e.getMessage());
signal();
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can return here, and avoid the else thing?

@openshift-ci
Copy link

openshift-ci bot commented Apr 14, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: eloycoto

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 179ff4e into parodos-dev:main Apr 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants