Permalink
Browse files

More robust resuming of paused request

  • Loading branch information...
1 parent d1393c5 commit 7f87ce4d67c931f815f52a3bcf1802cd18ea4c8a @jcheng5 jcheng5 committed Jan 5, 2013
Showing with 6 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +3 −1 lib/proxy/http.js
  3. +2 −0 lib/proxy/sockjs.js
View
@@ -1,3 +1,4 @@
build/
node_modules/
npm-debug.log
+*.swp
View
@@ -129,7 +129,6 @@ function ShinyProxy(router, workerRegistry) {
logger.trace('Proxying request: ' + req.url);
appWorkerHandle.proxy.proxyRequest(req, res);
- paused.resume();
})
.fail(function(err) {
logger.info('Error getting worker: ' + err);
@@ -139,6 +138,9 @@ function ShinyProxy(router, workerRegistry) {
error500(req, res, 'The application failed to start.', err.message,
err.consoleLogFile);
})
+ .fin(function() {
+ paused.resume();
+ })
.done();
})
.done();
View
@@ -37,6 +37,8 @@ function createServer(router, workerRegistry) {
return; // Request was fully handled
}
connectToApp(conn, appSpec);
+ })
+ .fin(function() {
// Now that event handlers are hooked up to the connection, it's safe
// to unpause
paused.resume();

0 comments on commit 7f87ce4

Please sign in to comment.