mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-02-14 04:59:16 +00:00
remove duplicate terminal output
This commit is contained in:
parent
a109eb577c
commit
157c530d6b
@ -9,6 +9,10 @@ define([
|
|||||||
|
|
||||||
init: function() {
|
init: function() {
|
||||||
console.log('init builds console output');
|
console.log('init builds console output');
|
||||||
|
|
||||||
|
// the only purpose of this hash to reconnect all the time
|
||||||
|
// except first, see notes at using
|
||||||
|
this.connectedResourcesHash = {};
|
||||||
},
|
},
|
||||||
|
|
||||||
onReadTerminalOutput: function(build) {
|
onReadTerminalOutput: function(build) {
|
||||||
@ -17,7 +21,14 @@ define([
|
|||||||
resourceName = 'build' + build.id;
|
resourceName = 'build' + build.id;
|
||||||
|
|
||||||
var connectToBuildDataResource = function() {
|
var connectToBuildDataResource = function() {
|
||||||
connect.resource(resourceName).reconnect();
|
// reconnect for get data below (at subscribe), coz
|
||||||
|
// data emitted only once during connect
|
||||||
|
if (self.connectedResourcesHash[resourceName]) {
|
||||||
|
connect.resource(resourceName).reconnect();
|
||||||
|
} else {
|
||||||
|
self.connectedResourcesHash[resourceName] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
connect.resource(resourceName).subscribe('data', function(data) {
|
connect.resource(resourceName).subscribe('data', function(data) {
|
||||||
output += data;
|
output += data;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user