Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Lint batch module.

  • Loading branch information...
commit 326e855b558cb3d1ae3191496a236825ec3b19bb 1 parent 4d778eb
@reid reid authored
Showing with 13 additions and 9 deletions.
  1. +13 −9 lib/hub/batch.js
View
22 lib/hub/batch.js
@@ -27,7 +27,8 @@ function Batch(manager, id, session, tests, useProxy) {
this.testServer = new TestServer(
'<script src="/socket.io/socket.io.js"></script>' +
- '<script src="/public/inject.js"></script>');
+ '<script src="/public/inject.js"></script>'
+ );
EventEmitter2.call(this);
@@ -108,13 +109,12 @@ Batch.prototype.dispatch = function () {
// Freeze the current available agents.
// TODO: Only select agents asked for.
- var agents = this.manager.agentManager.getAgents();
+ var agents = this.manager.agentManager.getAgents(),
+ urls = [],
+ self = this;
this.manager.lockAgents(this.id, agents);
- var urls = [],
- self = this;
-
if (self.useProxy) {
self.tests.forEach(function (test) {
urls.push("/batch/" + self.id + "/test/" + test);
@@ -151,10 +151,12 @@ Batch.prototype.handleFileRequest = function (server, filename) {
if (agentId) {
agent = batch.agents[agentId];
}
+ /*
if (agent) {
// TODO: Advance to next test with 302 Found.
// Emit error for CLI.
}
+ */
server.res.writeHead(500, {
"content-type": "text/plain"
@@ -215,12 +217,14 @@ BatchManager.prototype.getBatch = function (id) {
};
BatchManager.prototype.getBatchByAgent = function (agentId) {
- var batchId = this.batchAgent[agentId];
+ var batch = false,
+ batchId = this.batchAgent[agentId];
+
if (batchId) {
- return this.batches[batchId];
- } else {
- return false;
+ batch = this.batches[batchId];
}
+
+ return batch;
};
// Called by the Batch itself
Please sign in to comment.
Something went wrong with that request. Please try again.