From 6375eaa552970aa8fefadc3c760562be9f3f046e Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Fri, 11 Jul 2014 16:52:22 -0700 Subject: [PATCH] fixed issue w/ buffer blocking on write to websocket --- server/app/scripts/app.js | 17 ++++++++--------- server/app/scripts/services/stdout.js | 3 +++ server/app/views/commit.html | 6 +++--- server/main.go | 4 ---- server/pubsub/buffer.go | 4 +++- server/pubsub/channel.go | 3 +-- server/worker/worker.go | 7 ++++--- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/server/app/scripts/app.js b/server/app/scripts/app.js index 8167238e6..7da26666f 100644 --- a/server/app/scripts/app.js +++ b/server/app/scripts/app.js @@ -245,7 +245,13 @@ app.controller("CommitController", function($scope, $http, $routeParams, stdout, $scope.commit = data; if (data.status!='Started' && data.status!='Pending') { - return; + $http({method: 'GET', url: '/v1/repos/'+remote+'/'+owner+"/"+name+"/branches/"+branch+"/commits/"+commit+"/console"}). + success(function(data, status, headers, config) { + $scope.console = data; + }). + error(function(data, status, headers, config) { + console.log(data); + }); } stdout.subscribe(data.id, function(out){ @@ -256,13 +262,6 @@ app.controller("CommitController", function($scope, $http, $routeParams, stdout, console.log(data); }); - // load the repo build stdout - $http({method: 'GET', url: '/v1/repos/'+remote+'/'+owner+"/"+name+"/branches/"+branch+"/commits/"+commit+"/console"}). - success(function(data, status, headers, config) { - $scope.console = data; - }). - error(function(data, status, headers, config) { - console.log(data); - }); + }); \ No newline at end of file diff --git a/server/app/scripts/services/stdout.js b/server/app/scripts/services/stdout.js index 18ce7e608..5e353e482 100644 --- a/server/app/scripts/services/stdout.js +++ b/server/app/scripts/services/stdout.js @@ -16,6 +16,9 @@ angular.module('app').service('stdout', ['$window', function($window) { callback(event.data); } }; + websocket.onclose = function(event) { + console.log('websocket closed at '+path); + }; }; this.unsubscribe = function() { diff --git a/server/app/views/commit.html b/server/app/views/commit.html index 8e9c1b786..0c9bc03ff 100644 --- a/server/app/views/commit.html +++ b/server/app/views/commit.html @@ -6,8 +6,8 @@ -
-

3.5 ms

+
+

{{ commit.duration | toDuration}}

@@ -19,7 +19,7 @@
-
+