Skip to content

Commit

Permalink
fix: increase investigate time; more feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-richards committed Jan 22, 2025
1 parent 567d55f commit bbce1c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
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

0 comments on commit bbce1c8

Please sign in to comment.