add task types enum

This commit is contained in:
moicen
2021-09-21 10:09:25 +08:00
parent 1ff49b6597
commit b67e6686db
+6 -1
View File
@@ -6,6 +6,11 @@ local chunk_size = 4096
local form = upload:new(chunk_size)
uuid.seed()
TaskTypes = {
NOOP = 'NOOP',
UPLOAD_PICTURE = 'UPLOAD_PICTURE'
}
local task_server = ngx.var.task_server
local file_dir = ngx.var.tmp_file_dir
local file
@@ -68,7 +73,7 @@ while true do
["Content-Type"] = "application/json",
["Authorization"] = ngx.req.get_headers().Authorization
},
body = cjson.encode({task_type = 1, data = {images = files}}),
body = cjson.encode({task_type = TaskTypes.UPLOAD_PICTURE, data = {images = files}}),
}
)
if 201 ~= res.status then