service-geoip
Advanced tools
Comparing version 1.3.0 to 1.3.1
{ | ||
"amqp": "amqp://V9DB1pifFT2VuhTr2A3s:553HL.z0S9883c[tyl0R@18cf6127-pukoren.node.tutum.io", | ||
"amqp": "amqp://localhost", | ||
"queue": "geo:ip", | ||
"port": 8080 | ||
} | ||
} |
@@ -33,18 +33,26 @@ var fs = require('fs'), | ||
reqs++; | ||
console.log(' [.] Answered', location); | ||
} | ||
amqp.connect(process.env.AMQP_SRV || config.amqp).then(function(_conn) { | ||
conn = _conn; | ||
return conn.createChannel().then(function(_channel) { | ||
channel = _channel; | ||
return channel.assertQueue(process.env.AMQP_QUEUE || config.queue, {durable: false}) | ||
.then(function() { | ||
channel.prefetch(1); | ||
return channel.consume(process.env.AMQP_QUEUE || config.queue, reply); | ||
}) | ||
.then(function() { | ||
console.log(' [x] Awaiting RPC requests'); | ||
}); | ||
function connect() { | ||
amqp.connect(process.env.AMQP_SRV || config.amqp).then(function(_conn) { | ||
conn = _conn; | ||
return conn.createChannel().then(function(_channel) { | ||
channel = _channel; | ||
return channel.assertQueue(process.env.AMQP_QUEUE || config.queue, {durable: false}) | ||
.then(function() { | ||
channel.prefetch(1); | ||
return channel.consume(process.env.AMQP_QUEUE || config.queue, reply); | ||
}) | ||
.then(function() { | ||
console.log(' [x] Awaiting RPC requests'); | ||
}); | ||
}); | ||
}).catch(function(e){ | ||
setTimeout(connect, 1000); | ||
console.log(e); | ||
}); | ||
}).then(null, console.warn); | ||
} | ||
connect(); |
{ | ||
"name": "service-geoip", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "A RabbitMQ microservice wrapping the node-geoip package (geoip-lite on npm).", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
var lib = require('../index'), | ||
config = require('../config.json'); | ||
console.log = function() {} | ||
describe('Module required', function() { | ||
@@ -7,0 +5,0 @@ it('should not be undefined', function(){ |
var lib = require('../lib/geoip-service'); | ||
console.log = function() {} | ||
describe('Module entry point', function() { | ||
@@ -6,0 +4,0 @@ it('should not be undefined', function(){ |
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
27110
14
200