Commit 2009d322 authored by Kamron Aroonrua's avatar Kamron Aroonrua 💬

buffer alloc

parent 1aeaaaf2
...@@ -25,7 +25,7 @@ memstore.prototype.getItem = function(k,cb) ...@@ -25,7 +25,7 @@ memstore.prototype.getItem = function(k,cb)
if(!err && v){ if(!err && v){
if(typeof v == 'object' && v.type == 'Buffer') if(typeof v == 'object' && v.type == 'Buffer')
{ {
value = new Buffer.from(v.data); value = Buffer.from(v.data);
}else{ }else{
value = JSON.parse(v); value = JSON.parse(v);
} }
......
...@@ -29,7 +29,7 @@ module.exports.newdata = function(prm,cb){ ...@@ -29,7 +29,7 @@ module.exports.newdata = function(prm,cb){
var msg = JSON.stringify(objMsg); var msg = JSON.stringify(objMsg);
ch.assertExchange(ex, 'topic', {durable: false}); ch.assertExchange(ex, 'topic', {durable: false});
ch.publish(ex, key, new Buffer(msg)); ch.publish(ex, key, Buffer.from(msg));
//console.log("[AMQP] Sent %s:'%s'", key, msg); //console.log("[AMQP] Sent %s:'%s'", key, msg);
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment