From 416d5981700fa13169155de9835eff32e6e34d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E7=94=B7?= Date: Mon, 8 Nov 2021 16:49:40 +0800 Subject: [PATCH] add log --- prod/upload/upload.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/prod/upload/upload.lua b/prod/upload/upload.lua index 1438b7d..e8e0f8c 100644 --- a/prod/upload/upload.lua +++ b/prod/upload/upload.lua @@ -63,9 +63,14 @@ while true do local http = require "resty.http" local httpc = http.new() local remote_url = string.format("%s/api/v1/ts/create_task", task_server) + ngx.log(ngx.INFO, 'remote_url -> ', remote_url) - ngx.log(ngx.INFO, 'authorization -> ', ngx.req.get_headers().Authorization) + ngx.log(ngx.INFO, 'Authorization -> ', ngx.req.get_headers().Authorization) ngx.log(ngx.INFO, 'HtySudoerToken -> ', ngx.req.get_headers().HtySudoerToken) + + local body_text = cjson.encode({task_type = TaskTypes.UPLOAD_PICTURE, data = {images = files}}) + + ngx.log(ngx.INFO, 'UPLOAD_PICTURE body_text ->', body_text) local res, err = httpc:request_uri( remote_url, { @@ -75,7 +80,7 @@ while true do ["Authorization"] = ngx.req.get_headers().Authorization, ["HtySudoerToken"] = ngx.req.get_headers().HtySudoerToken }, - body = cjson.encode({task_type = TaskTypes.UPLOAD_PICTURE, data = {images = files}}), + body = body_text, } ) if 201 ~= res.status then