chore: only expose the method of setting random seed. (#45)
the user may be have set the random seed already.
diff --git a/lib/skywalking/util.lua b/lib/skywalking/util.lua
index fe0548c..79580db 100644
--- a/lib/skywalking/util.lua
+++ b/lib/skywalking/util.lua
@@ -81,13 +81,15 @@
end
-math.randomseed(random_seed())
+_M.set_randomseed = function ()
+ math.randomseed(random_seed())
+end
+
local newID
-- for Nginx Lua
local ok, uuid = pcall(require, "resty.jit-uuid")
if ok then
- uuid.seed()
newID = function()
return uuid.generate_v4()
end