clean up code and comments

This commit is contained in:
Karol Wypchlo 2022-03-21 14:43:42 +01:00
parent 75fad4fb91
commit c19ef307d8
No known key found for this signature in database
GPG Key ID: B515DE9EEBE241E1
3 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,3 @@
# register the download in accounts service (cookies should contain jwt)
log_by_lua_block {
local skynet_account = require("skynet.account")
@ -22,7 +21,8 @@ log_by_lua_block {
end
if ngx.header["Skynet-Skylink"] and ngx.status >= ngx.HTTP_OK and ngx.status < ngx.HTTP_SPECIAL_RESPONSE then
local ok, err = ngx.timer.at(0, track, ngx.header["Skynet-Skylink"], ngx.status, ngx.var.body_bytes_sent, skynet_account.get_auth_headers())
local auth_headers = skynet_account.get_auth_headers()
local ok, err = ngx.timer.at(0, track, ngx.header["Skynet-Skylink"], ngx.status, ngx.var.body_bytes_sent, auth_headers)
if err then ngx.log(ngx.ERR, "Failed to create timer: ", err) end
end
end

View File

@ -1,4 +1,3 @@
# register the registry access in accounts service (cookies should contain jwt)
log_by_lua_block {
local skynet_account = require("skynet.account")
@ -25,7 +24,8 @@ log_by_lua_block {
end
if ngx.status == ngx.HTTP_OK or ngx.status == ngx.HTTP_NOT_FOUND then
local ok, err = ngx.timer.at(0, track, ngx.req.get_method(), skynet_account.get_auth_headers())
local auth_headers = skynet_account.get_auth_headers()
local ok, err = ngx.timer.at(0, track, ngx.req.get_method(), auth_headers)
if err then ngx.log(ngx.ERR, "Failed to create timer: ", err) end
end
end

View File

@ -1,4 +1,3 @@
# register the upload in accounts service (cookies should contain jwt)
log_by_lua_block {
local skynet_account = require("skynet.account")
@ -22,7 +21,8 @@ log_by_lua_block {
-- report all skylinks (header empty if request failed) but only if jwt is preset (user is authenticated)
if ngx.header["Skynet-Skylink"] then
local ok, err = ngx.timer.at(0, track, ngx.header["Skynet-Skylink"], skynet_account.get_auth_headers())
local auth_headers = skynet_account.get_auth_headers()
local ok, err = ngx.timer.at(0, track, ngx.header["Skynet-Skylink"], auth_headers)
if err then ngx.log(ngx.ERR, "Failed to create timer: ", err) end
end
end