-
Notifications
You must be signed in to change notification settings - Fork 31
feat(handler) remove dependency on base plugin #50
Conversation
9976a12
to
c7293f9
Compare
kong/plugins/zipkin/opentracing.lua
Outdated
|
||
-- We want to run first so that timestamps taken are at start of the phase | ||
-- also so that other plugins might be able to use our structures | ||
OpenTracingHandler.PRIORITY = 100000 | ||
|
||
function OpenTracingHandler:new(name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this :new
function still being used with the removal of BasePlugin?
In other plugins where BasePlugin was removed, the :new
operation was removed altogether. Generally, it was just boilerplate, but in the case of this plugin it does a thing in line 23 below which I'm not seeing in Kong's plugin handling how it ever gets executed (though I may be just missing it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I missed the new
function. Removing it.
kong/plugins/zipkin/opentracing.lua
Outdated
|
||
-- We want to run first so that timestamps taken are at start of the phase | ||
-- also so that other plugins might be able to use our structures | ||
OpenTracingHandler.PRIORITY = 100000 | ||
|
||
function OpenTracingHandler:new(name) | ||
OpenTracingHandler.super.new(self, name or "opentracing") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super
is being set to self
below... Wouldn't this cause an infinite loop if this line was ever to run? (Seems to indicate :new
is never being called, in which case self.conf_to_tracer
needs to be initialized somewhere else)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
infinite loop
Removed :new
, so that won't happen here.
self.conf_to_tracer
That member variable seemed to be a simple "cache" for traces. I made it a "module local cache" instead.
c7293f9
to
9fa33d3
Compare
This completes the work started in #50
This completes the work started in #50
This PR also re-indents all the source code with spaces.