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

Implement task progress HTTP polling #543

Merged
merged 2 commits into from
Dec 27, 2023
Merged

Implement task progress HTTP polling #543

merged 2 commits into from
Dec 27, 2023

Conversation

DavidePrincipi
Copy link
Member

If the web socket is closed task progress messages are lost. If the "completed" or "aborted" message is among lost messages a progress notifications remains freezed.

Add a setTimeout/clearTimeout invocation for each WS message received. After 10 seconds, if no further message comes send an HTTP GET request with getTaskStatus() to verify the task status from API server.

If the HTTP request fails, try again after 10 seconds. If it succeedes generate a synthesized progress message that completes the task progress at 100%.

NethServer/dev#6778

If the web socket is closed task progress messages are lost. If the
"completed" or "aborted" message is among lost messages a progress
notifications remains freezed.

Add a setTimeout/clearTimeout invocation for each WS message received.
After 10 seconds, if no further message comes send an HTTP GET request
with getTaskStatus() to verify the task status from API server.

If the HTTP request fails, try again after 10 seconds. If it succeedes
generate a synthesized progress message that completes the task
progress at 100%.
@DavidePrincipi DavidePrincipi self-assigned this Dec 22, 2023
Copy link
Contributor

@andre8244 andre8244 left a comment

Choose a reason for hiding this comment

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

LGTM, but please add some comments to ease a little bit readability and maintainability

@DavidePrincipi DavidePrincipi merged commit fe17db5 into main Dec 27, 2023
2 checks passed
@DavidePrincipi DavidePrincipi deleted the fix-6778 branch December 27, 2023 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants