Skip to content

Commit

Permalink
fixed code style.
Browse files Browse the repository at this point in the history
  • Loading branch information
moonming committed Jul 26, 2019
1 parent a1abc88 commit 315c179
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions lua/apisix/plugins/zipkin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@ end

local function create_tracer(conf)
local tracer = new_tracer(new_reporter(conf), new_random_sampler(conf))
tracer:register_injector("http_headers", zipkin_codec.new_injector())
tracer:register_extractor("http_headers", zipkin_codec.new_extractor())
return tracer
tracer:register_injector("http_headers", zipkin_codec.new_injector())
tracer:register_extractor("http_headers", zipkin_codec.new_extractor())
return tracer
end

local function report2endpoint(premature, reporter)
if premature then
return
end

local ok, err = reporter:flush()
if not ok then
core.log.error("reporter flush ", err)
return
if premature then
return
end

local ok, err = reporter:flush()
if not ok then
core.log.error("reporter flush ", err)
return
end

core.log.info("report2endpoint ok")
Expand Down Expand Up @@ -162,11 +162,11 @@ function _M.log(conf, ctx)
opentracing.proxy_span:finish(log_end_time)
opentracing.request_span:finish(log_end_time)

local reporter = opentracing.tracer.reporter
local ok, err = ngx.timer.at(0, report2endpoint, reporter)
if not ok then
core.log.error("failed to create timer: ", err)
end
local reporter = opentracing.tracer.reporter
local ok, err = ngx.timer.at(0, report2endpoint, reporter)
if not ok then
core.log.error("failed to create timer: ", err)
end
end

return _M

0 comments on commit 315c179

Please sign in to comment.