-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 auto-refresh time interval setting #2581
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2581 +/- ##
==========================================
+ Coverage 53.59% 53.62% +0.03%
==========================================
Files 560 562 +2
Lines 11882 11949 +67
==========================================
+ Hits 6368 6408 +40
- Misses 5296 5319 +23
- Partials 218 222 +4
Continue to review full report at Codecov.
|
src/app/frontend/logs/component.js
Outdated
this.interval_(() => { | ||
if (this.logsService.getFollowing()) { | ||
this.loadNewest(); | ||
this.log_.info('Automatically refreshed logs'); |
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'd remove that to avoid unnecessary spam in a console.
src/app/frontend/logs/component.js
Outdated
@@ -123,12 +131,15 @@ export class LogsController { | |||
* @private | |||
*/ | |||
registerIntervalFunction_() { |
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.
After starting it, interval function will be running in the background forever. I'd start/stop whole interval function on button click. It returns a promise and interval.cancel(promise)
can be used to stop it.
src/app/frontend/logs/component.js
Outdated
@@ -176,6 +183,7 @@ export class LogsController { | |||
* @export | |||
*/ | |||
toggleLogFollow() { | |||
this.toggleIntervalFunction_(); | |||
this.logsService.setFollowing(); |
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.
By swapping this line with toggling interval we can get rid of below if statement. Logs will be reloaded immediately after first interval start.
No description provided.