add task types enum
This commit is contained in:
@@ -6,6 +6,11 @@ local chunk_size = 4096
|
|||||||
local form = upload:new(chunk_size)
|
local form = upload:new(chunk_size)
|
||||||
uuid.seed()
|
uuid.seed()
|
||||||
|
|
||||||
|
TaskTypes = {
|
||||||
|
NOOP = 'NOOP',
|
||||||
|
UPLOAD_PICTURE = 'UPLOAD_PICTURE'
|
||||||
|
}
|
||||||
|
|
||||||
local task_server = ngx.var.task_server
|
local task_server = ngx.var.task_server
|
||||||
local file_dir = ngx.var.tmp_file_dir
|
local file_dir = ngx.var.tmp_file_dir
|
||||||
local file
|
local file
|
||||||
@@ -68,7 +73,7 @@ while true do
|
|||||||
["Content-Type"] = "application/json",
|
["Content-Type"] = "application/json",
|
||||||
["Authorization"] = ngx.req.get_headers().Authorization
|
["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
|
if 201 ~= res.status then
|
||||||
|
|||||||
Reference in New Issue
Block a user