-
Notifications
You must be signed in to change notification settings - Fork 6
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
ALS-7014: Implement signed URL functionality for data exports #119
Conversation
// This happens sometimes when users immediately request the status for a query | ||
// before it can be initialized. We wait a bit and try again before throwing an | ||
// error. | ||
try { | ||
Thread.sleep(100); | ||
} catch (InterruptedException e) { | ||
return ResponseEntity.status(500).build(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does waiting do? Are you debouncing a button on the backend?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is boilerplate code copied from the /result endpoint. But true, it should not be needed, no one should call this endpoint until the status returns SUCCESS which would mean the query exists
.contentType(MediaType.APPLICATION_JSON) | ||
.body(new SignedUrlResponse(presignedGetUrl)); | ||
} else { | ||
return ResponseEntity.status(400).body("Status : " + result.getStatus().name()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is 400 a fair response code for pending statuses? Maybe 202?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think it is appropriate. Or at least consistent with the current workflow of the /result endpoint. The front end polls /status until it is SUCCESS, then calls this endpoint for a signed url, or /result for the document itself
No description provided.