File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
metrics-service-ui/frontend/public/hystrix-dashboard/monitor Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ function getUrlVars() {
20
20
}
21
21
22
22
var hystrixStreams = [ ] ;
23
+ // CHANGE: make source a global variable so it can be closed when set a new stream
24
+ var source = null ; // EventSource that holds SSE connection
23
25
24
26
function addStreams ( proxyStream , title ) {
25
27
// CHANGE: rely on function parameters instead of parsing window.location.href
@@ -72,8 +74,13 @@ function addStreams(proxyStream, title) {
72
74
73
75
// CHANGE: removed proxyStream variable declaration in favour of function parameter
74
76
77
+ // CHANGE: make source a global variable so it can be closed when set a new stream
78
+ if ( source !== null ) {
79
+ source . close ( ) ;
80
+ }
75
81
// start the EventSource which will open a streaming connection to the server
76
- var source = new EventSource ( proxyStream ) ;
82
+ source = new EventSource ( proxyStream ) ;
83
+ // END OF CHANGE
77
84
78
85
// add the listener that will process incoming events
79
86
// CHANGE: add filter for adding listener so listener is only added for streams that match the selected stream to display
You can’t perform that action at this time.
0 commit comments