仓库指标
- Star
- (22,778 star)
- PR 合并指标
- (30 天内没有已合并 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...