倉庫指標
- 星標
- (22,778 顆星)
- PR 合併指標
- (PR 指標待抓取)
描述
So there is this thing called async hooks in Node now that allow for stuff to be preserved like you would with thread local in other languages. A popular library that uses that is cls-hooked. This is very useful to put trace ID and add that trace to the logs when you want to do distributed logging (or add a user ID to have some context for your logs). However, the machine that powers sails messes up with this process and we lose the information when an helper is called. I am not sure what happens, but it is most likely related to how the machine that powers sails works (by making HTTP calls I believe for each helper). I think @mikermcneil would be the one to answer that since not a lot people seem to have touched this code except him...