2017-02-19 134 views
0

這讓我難以置信。節點Redis命令不會運行?

我有觸發下面的下面的源代碼BLPOP。當第一次觸發源時,只有第一個Redis調用被觸發......第二個不會被觸發,直到有另一個彈出並且源代碼再次運行?

null 
DEBUG - 8621 - Sat Feb 18 2017 20:47:53 GMT-0600 (CST) - 5 totalConnections 2000 
null 
DEBUG - 8621 - Sat Feb 18 2017 20:47:54 GMT-0600 (CST) - 5 expectedConnections 500 
null 
DEBUG - 8621 - Sat Feb 18 2017 20:47:54 GMT-0600 (CST) - 5 totalConnections 2100 

來源

const expectedConnectionsKey = ['test', id, 'expectedConnections'].join(':'); 
const totalConnectionsKey = ['test', id, 'connections'].join(':'); 
watcher.client.incrby(totalConnectionsKey, connections, (error, totalConnections) => { 
    console.log(error); 
    log.debug(id, 'totalConnections', totalConnections); 
    watcher.client.get(expectedConnectionsKey, (error, expectedConnections) => { 
     console.log(error); 
     log.debug(id, 'expectedConnections', expectedConnections); 
    }); 
}); 

回答

0

問題是具有定時...

我曾在同一信道上的BLPOP,只有其中一個命令之前BLPOP開始等待再次得到了執行。