From 69bf316e82193a791bb5926afa94eeb55b931969 Mon Sep 17 00:00:00 2001 From: Mehmet Suslu <> Date: Tue, 10 Dec 2024 21:15:07 +0300 Subject: [PATCH] [FIX] seed the random number generator Otherwise, it creates the same number sequence, and so does the event ids. --- raven/util.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/raven/util.lua b/raven/util.lua index e9326e7..4ada709 100644 --- a/raven/util.lua +++ b/raven/util.lua @@ -12,7 +12,9 @@ local string_find = string.find local string_sub = string.sub local string_match = string.match local math_random = math.random +local math_randomseed = math.randomseed local os_date = os.date +local os_time = os.time local _M = {} @@ -28,6 +30,9 @@ function _M.errlog(...) print("[ERROR]", ...) end +-- Seed the random number generator +math_randomseed(os_time()) + --- Returns a string suitable to be used as `event_id`. -- @return a new random `event_id` string. function _M.generate_event_id()