错误:'this.adapter.clients'使用sailsjs publishCreate时

时间:2017-04-04 17:16:35

标签: sails.js

我收到此错误

Tbl_Direct_Cash.create({
            amount_paid: amount_paid,
            payment_type: payment_type,
            payment_ID: payment_ID,
            tbl_user: tbl_user
        }).exec(function (e, r) {
            if (e) {
                console.log(e);
                return res.ok('TRANSACTION FAILED....TRY AGAIN');
            } else {

                //console.log(e);
                Tbl_Direct_Cash.publishCreate({id: 40});
                return res.ok('TRANSACTION SAVED');

            }
        });

当我在sailsjs中创建记录后尝试发布创建时 这是创建功能

notify: function (req, res) {
    if (req.isSocket) {
        Tbl_Direct_Cash.watch(req);
        Tbl_Deduction.watch(req);
        // Gene.watch(req);
        return res.ok()
    }
}

这是我的手表方法

io.socket.on('connect', function () {
    io.socket.get('/dashboard/notify', function (e, r) {
        console.log(e, r);
    });
})

创建请求是在通知请求

时从移动应用程序发送的
.tofile()

从管理客户端发送

1 个答案:

答案 0 :(得分:0)

My socket.io-redis version was very old. Updating it to the latest version solved the problem