delete uuid.lua redis.lua upload.lua
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
-- Require lua modules
|
||||
local upload = require "upload"
|
||||
local uuid = require "uuid"
|
||||
local redis = require "redis"
|
||||
local upload = require "resty/upload"
|
||||
local uuid = require "resty.jit-uuid"
|
||||
local redis = require "resty.redis"
|
||||
local cjson = require "cjson"
|
||||
---------------------------------------------------------------------------------------
|
||||
|
||||
@@ -30,6 +30,10 @@ if not form then
|
||||
ngx.exit(500)
|
||||
end
|
||||
|
||||
---- Automatic seeding with os.time(), LuaSocket, or ngx.time()
|
||||
uuid.seed()
|
||||
uuid()
|
||||
|
||||
---- Redis init
|
||||
------ Connect to redis
|
||||
local redis_task_database = redis:new()
|
||||
@@ -92,7 +96,7 @@ while true do
|
||||
-- Save upload file
|
||||
if upload_image_filename then
|
||||
-- Save file name with generate uuid
|
||||
save_image_filename = uuid:generate() -- Generate save filename uuid
|
||||
save_image_filename = uuid:generate_v4() -- Generate save filename uuid
|
||||
save_image_filename = save_image_filename .. '.' .. upload_image_filename:match(".+%.(%w+)$")
|
||||
file_to_save = io.open(save_upload_file_path .. save_image_filename, "w+")
|
||||
|
||||
@@ -154,7 +158,7 @@ if ret_save then
|
||||
|
||||
-- Communicate with front end
|
||||
---- Generate task uuid
|
||||
local task_uuid = uuid.generate();
|
||||
local task_uuid = uuid.generate_v4();
|
||||
---------------------------------------------------------------------------------------
|
||||
|
||||
-- Construct {key: task_id | value: [images] } in json
|
||||
|
||||
Reference in New Issue
Block a user