Dashboard: avoid blocking on todos ajax calls
The Dashboard calls
/usr/libexec/nethserver/admin-todos to display a list of todos at the top of the page.
The request is made with an asynchronous ajax call, but if response takes a long time, the browser will wait for the pending request blocking any other action on the web interface.
Since each todo is a self-contained script, there is no way to know how long the server will take for the response.
To workaround the problem, add a short timeout to the execution of each todo scripts.
#4 Updated by Giacomo Sanchietti over 4 years ago
- Status changed from MODIFIED to ON_QA
- Assignee deleted (
- % Done changed from 60 to 70
- Install the new package on a clean machine
- Create a todo script which sleeps for 10 seconds:
echo -e '#!/bin/bash\nsleep 10\n' > /etc/nethserver/todos.d/80test chmod a+x /etc/nethserver/todos.d/80test
/etc/nethserver/todos.d/80testand check the command doesn't sleep for all 10 seconds:
#5 Updated by Filippo Carletti over 4 years ago
- Status changed from ON_QA to VERIFIED
- % Done changed from 70 to 90
I added the fake sleep-10 todo and verified that the server-manager hung for 10 second after accessing the dashboard.
Then I installed the updated package and repetaed the same steps: the server-manager hung for only 2 seconds.
I think that a 2 seconds reaction to a click is not perceived as an hung.