If I didn't set callback when execute redis command like del, will throw a error as below.
Record at (spanId=be186f731a57d3d5, parentId=be186f731a57d3d5, traceId=be186f731a57d3d5): Rpc("del")
Record at (spanId=be186f731a57d3d5, parentId=be186f731a57d3d5, traceId=be186f731a57d3d5): ServiceName("test")
Record at (spanId=be186f731a57d3d5, parentId=be186f731a57d3d5, traceId=be186f731a57d3d5): ServerAddr(serviceName="redis", host="InetAddress(undefined)", port=0)
Record at (spanId=be186f731a57d3d5, parentId=be186f731a57d3d5, traceId=be186f731a57d3d5): ClientSend()
Record at (spanId=be186f731a57d3d5, parentId=be186f731a57d3d5, traceId=be186f731a57d3d5): ClientRecv()
/Library/WebServer/projects/qr-wap-pay/node_modules/continuation-local-storage/context.js:55
throw exception;
^
TypeError: callback.apply is not a function
at /Library/WebServer/projects/qr-wap-pay/node_modules/zipkin-instrumentation-redis/lib/zipkinClient.js:31:18
at /Library/WebServer/projects/qr-wap-pay/node_modules/zipkin-context-cls/lib/CLSContext.js:53:16
at /Library/WebServer/projects/qr-wap-pay/node_modules/zipkin-context-cls/lib/CLSContext.js:42:18
at Namespace.run (/Library/WebServer/projects/qr-wap-pay/node_modules/continuation-local-storage/context.js:48:5)
at CLSContext.scoped (/Library/WebServer/projects/qr-wap-pay/node_modules/zipkin-context-cls/lib/CLSContext.js:41:21)
at CLSContext.letContext (/Library/WebServer/projects/qr-wap-pay/node_modules/zipkin-context-cls/lib/CLSContext.js:51:19)
at Tracer.letId (/Library/WebServer/projects/qr-wap-pay/node_modules/zipkin/lib/tracer/index.js:73:28)
at zipkinCallback (/Library/WebServer/projects/qr-wap-pay/node_modules/zipkin-instrumentation-redis/lib/zipkinClient.js:30:14)
at Object.callbackOrEmit [as callback_or_emit] (/Library/WebServer/projects/qr-wap-pay/node_modules/redis/lib/utils.js:89:9)
at RedisClient.return_error (/Library/WebServer/projects/qr-wap-pay/node_modules/redis/index.js:701:11)
https://github.com/openzipkin/zipkin-js/blob/master/packages/zipkin-instrumentation-redis/src/zipkinClient.js#L23
If I didn't set callback when execute redis command like
del
, will throw a error as below.test code:
If should judgment the callback is set or not before apply callback ?