feat(lua): TS task IMAGE_FORM_COMPRESS for compress upload audit

Made-with: Cursor
This commit is contained in:
2026-04-28 10:14:28 +08:00
parent bb95a39dfa
commit 93f47042d5
+3 -4
View File
@@ -1,4 +1,4 @@
-- 压缩直传成功后向 Rust TS(3003)登记 NOOP,便于管理端 Tasks 可追溯(非 UPLOAD_PICTURE:后者专指 combine 管线)。
-- 压缩直传成功后向 Rust TS(3003)登记 IMAGE_FORM_COMPRESS,便于管理端 Tasks 可追溯(非 UPLOAD_PICTURE:后者专指 combine 管线)。
local cjson = require("cjson")
local function create(httpc, auth_header, sudoer_token, public_url)
@@ -6,9 +6,8 @@ local function create(httpc, auth_header, sudoer_token, public_url)
local remote_url = "http://" .. ts_host .. "/api/v1/ts/create_task"
local hty_host = ngx.req.get_headers()["HtyHost"] or ""
local body_tbl = {
task_type = "NOOP",
task_type = "IMAGE_FORM_COMPRESS",
payload = {
kind = "IMAGE_FORM_COMPRESS",
url = public_url,
},
}
@@ -32,7 +31,7 @@ local function create(httpc, auth_header, sudoer_token, public_url)
ngx.log(ngx.ERR, "IMAGE_FORM_COMPRESS audit: status=", res.status, " body=", res.body)
return false
end
ngx.log(ngx.INFO, "IMAGE_FORM_COMPRESS audit noop created")
ngx.log(ngx.INFO, "IMAGE_FORM_COMPRESS audit task created")
return true
end