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

fix: increase investigate time; more feedback #8457

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ietf/static/js/investigate.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ document.addEventListener('DOMContentLoaded', () => {
loadResultsFromTask('bogus-task-id') // bad task id will generate an error from Django
}
const taskId = (await response.json()).id
// Poll for completion of the investigation up to 18*10 = 180 seconds
waitForResults(taskId, 18)
// Poll for completion of the investigation up to 60*10 = 600 seconds
waitForResults(taskId, 60)
}

const waitForResults = async (taskId, retries) => {
// indicate that investigation is in progress
document.getElementById('spinner').classList.remove('d-none')
document.querySelectorAll('.investigation-indicator').forEach(elt => elt.classList.remove('d-none'))
document.getElementById('investigate-button').disabled = true
investigateForm.elements['id_name_fragment'].disabled = true

Expand Down
12 changes: 7 additions & 5 deletions ietf/templates/doc/investigate.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ <h1>Investigate</h1>
{% csrf_token %}
{% bootstrap_form form %}
<button class="btn btn-primary" type="submit" id="investigate-button">
<span id="spinner"
class="spinner-border spinner-border-sm d-none"
role="status"
aria-hidden="true">
</span>
<span class="spinner-border spinner-border-sm investigation-indicator d-none"
role="status"
aria-hidden="true">
</span>
Investigate
</button>
<div class="alert alert-info mt-3 d-none investigation-indicator">
Please be patient, processing may take several minutes.
</div>
</form>
</div>
{% if results %}
Expand Down
Loading