diff options
Diffstat (limited to 'src/mqtt')
-rw-r--r-- | src/mqtt/DillerMqtt.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mqtt/DillerMqtt.js b/src/mqtt/DillerMqtt.js index 3fe43dc..e991b40 100644 --- a/src/mqtt/DillerMqtt.js +++ b/src/mqtt/DillerMqtt.js @@ -1,7 +1,7 @@ var di = require('di'); var mqtt = require('mqtt'); -function DillerMqtt(config, diller) { +function DillerMqtt(config, tx) { var log = config.log(); function run() { @@ -22,7 +22,9 @@ function DillerMqtt(config, diller) { }); mqttClient.on('message', function (topic, message, payload) { - diller.onMessage(topic, message, payload); + tx(function (pg, dao, diller) { + return diller.onMessage(topic, message, payload); + }); }); } @@ -30,9 +32,9 @@ function DillerMqtt(config, diller) { run: run }; } -var Diller = require('../Diller'); +var DillerTx = require('../DillerTx'); var DillerConfig = require('../DillerConfig'); -di.annotate(DillerMqtt, new di.Inject(DillerConfig, Diller)); +di.annotate(DillerMqtt, new di.Inject(DillerConfig, DillerTx)); module.exports = DillerMqtt; |