add task types enum
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user