add log
This commit is contained in:
@@ -23,21 +23,21 @@ local function convert()
|
|||||||
local file_dir = ngx.var.tmp_file_dir
|
local file_dir = ngx.var.tmp_file_dir
|
||||||
ngx.req.read_body()
|
ngx.req.read_body()
|
||||||
local req_body = cjson.decode(ngx.req.get_body_data())
|
local req_body = cjson.decode(ngx.req.get_body_data())
|
||||||
ngx.log(ngx.INFO, 'REQ_BODY -> ', ngx.req.get_body_data())
|
ngx.log(ngx.INFO, 'convert_audio -> REQ_BODY -> ', ngx.req.get_body_data())
|
||||||
|
|
||||||
local input_audio_file = get_wx_media(httpc, req_body["payload"]["media_id"], cjson, pl);
|
local input_audio_file = get_wx_media(httpc, req_body["payload"]["media_id"], cjson, pl);
|
||||||
local converted_audio_file = file_dir .. "/" .. uuid.generate_v4() .. ".mp3";
|
local converted_audio_file = file_dir .. "/" .. uuid.generate_v4() .. ".mp3";
|
||||||
|
|
||||||
ngx.log(ngx.INFO, "Input audio file -> ", input_audio_file);
|
ngx.log(ngx.INFO, "convert_audio -> input audio file -> ", input_audio_file);
|
||||||
ngx.log(ngx.INFO, "Converted audio file -> ", converted_audio_file);
|
ngx.log(ngx.INFO, "convert_audio -> converted audio filename -> ", converted_audio_file);
|
||||||
|
|
||||||
local cmd = "/usr/local/bin/file_convert" .. " " .. input_audio_file .. " " .. converted_audio_file
|
local cmd = "/usr/local/bin/file_convert" .. " " .. input_audio_file .. " " .. converted_audio_file
|
||||||
|
|
||||||
ngx.log(ngx.INFO, 'Audio convert command -> ', cmd)
|
ngx.log(ngx.INFO, 'convert_audio -> Audio convert command -> ', cmd)
|
||||||
|
|
||||||
local result, _, code = os.execute(cmd)
|
local result, _, code = os.execute(cmd)
|
||||||
if result and code == 0 then
|
if result and code == 0 then
|
||||||
ngx.log(ngx.INFO, "result -> ", result);
|
ngx.log(ngx.INFO, "convert_audio - > result -> ", result);
|
||||||
upyun_upload.upload(converted_audio_file, nil);
|
upyun_upload.upload(converted_audio_file, nil);
|
||||||
else
|
else
|
||||||
ngx.status = 500
|
ngx.status = 500
|
||||||
|
|||||||
Reference in New Issue
Block a user