-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Add automatic retry to stream logs #23098
Conversation
@@ -226,6 +226,25 @@ export const fetchHassioLogsFollow = async ( | |||
signal | |||
); | |||
|
|||
export const fetchHassioLogsFollowSkip = async ( |
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.
Why adding a new command instead of adding an option param to the existing fetchHassioLogsFollow
command?
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.
I did it because the skip is more complex and needs the cursor and skip lines as addition parameters. But if you want I can rewrite fetchHassioLogsFollow
@@ -554,6 +578,13 @@ class ErrorLogCard extends LitElement { | |||
if (err.name === "AbortError") { | |||
return; | |||
} | |||
|
|||
// The stream can fail if the connection is lost or firefox service worker intercept the connection | |||
if (!retry && streamLogs) { |
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 can now also cause an infinite loop I guess? Can we make this check more specific?
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.
There shoulnd't be. Retry is set to false when the first chunk rendered successfully so we say we are in a healty state again. If it fails again beforehand we show the error.
Proposed change
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: