gearman-node-bda
Advanced tools
Comparing version 0.10.0 to 0.10.1
@@ -71,3 +71,3 @@ // Copyright 2013 The GearmaNode Library Authors. All Rights Reserved. | ||
this.functions = {}; | ||
this.readyReset = false; | ||
events.EventEmitter.call(this); | ||
@@ -160,6 +160,6 @@ Worker.logger.log('info', 'worker initialized with %d job server(s)', this.jobServers.length); | ||
Worker.prototype.resetAbilities = function(callback) { | ||
var jobServer, len=this.jobServers.length; | ||
var jobServer, len=this.jobServers.length, cbCount=len; | ||
callback=callback||function(){}; | ||
var timer = setTimeout(function(){callback(new Error("RESET_ABILITIES timeout!"));},10000); | ||
var check = function(){if(--len===0) { clearTimeout(timer); Worker.logger.log('debug','RESET_ABILITIES done'); callback(); } } | ||
var timer = setTimeout(function(){callback(new Error("RESET_ABILITIES timeout!"));},15000); | ||
var check = function(){if(--cbCount===0) { clearTimeout(timer); Worker.logger.log('debug','RESET_ABILITIES done'); callback(); } } | ||
@@ -307,7 +307,7 @@ Worker.logger.log('debug', 'RESET_ABILITIES on all servers...'); | ||
Worker.prototype.grabJob = function (numberOfJob) { | ||
var i=0,j=0; | ||
var i,j | ||
numberOfJob=numberOfJob?numberOfJob:1; | ||
for(i=0;i<numberOfJob;i++){ | ||
for (j = 0; i < this.jobServers.length; i ++) { | ||
this.jobServers[i].send(protocol.encodePacket(protocol.PACKET_TYPES.GRAB_JOB)); | ||
for (j = 0; j < this.jobServers.length; j ++) { | ||
this.jobServers[j].send(protocol.encodePacket(protocol.PACKET_TYPES.GRAB_JOB)); | ||
} | ||
@@ -429,5 +429,8 @@ } | ||
jobServer.send(protocol.encodePacket(packetType, packetData)); | ||
jobServer.send(protocol.encodePacket(protocol.PACKET_TYPES.GRAB_JOB)); | ||
if(!this.clientOrWorker.readyReset)// ensure the worker won't exit | ||
jobServer.send(protocol.encodePacket(protocol.PACKET_TYPES.GRAB_JOB)); | ||
this.close(); | ||
} | ||
}, Job.prototype); |
{ | ||
"name": "gearman-node-bda", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "Node.js library for the Gearman distributed job system with support for multiple servers", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
109659
1896