mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-29 05:06:36 +08:00
18b337d131
InitDB assigned the new pool over the old one without closing it. The panel's own restore flows call CloseDB first, but any other re-init leaked the replaced pool and its handle on the database file. On Windows that handle blocks deleting the file, which is why the four GetApiToken CLI tests failed their t.TempDir cleanup there: dbtest.InitDB opened the store, then GetApiToken's own InitDB replaced it. InitDB now closes the previous pool itself; sql.DB.Close is idempotent, so the restore flows behave as before.