mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-28 20:56:42 +08:00
249b38e156
Every InitLogger call built a new lumberjack rotator and dropped the old one without closing it, leaking a handle on 3xui.log per call, and loggers still writing through an old rotator kept it alive. On Windows the open handles block deleting the file, so TestInitLoggerConcurrentWithLogging failed its t.TempDir cleanup there. InitLogger now reuses the open rotator for the same path and closes it only when the path changes, and the test closes the logger it opened. Neither half is enough alone: with only one of them the test stays red on Windows.