fix(db): drop blocking SQLite fallback connect in Connect_DB() - #32
Merged
Conversation
Connect_DB() fell back to a synchronous SQLite_UseDatabase() (SQL_ConnectCustom()) connect whenever no "vip_test" entry existed in databases.cfg, blocking the game thread on every (re)connect in that configuration. SQL_TConnect() already falls back to an implicit local SQLite database for an unrecognized config name, so a single async call now covers both the MySQL and SQLite cases. Bumped plugin version to 1.0.9.
SQL_TConnect() is non-blocking, but it's the legacy Handle-based connect API. Standardize on the newer Database.Connect() methodmap so the connect path isn't mixing the old SQLTCallback style with the modern Database/ SQLConnectCallback style. Also drops the now-dead data==1/2 branch in DB_OnConnect() that only existed to distinguish the removed sync fallback from the async connect.
Member
Author
|
Added a follow-up commit: switched |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Connect_DB()fell back to a synchronousSQLite_UseDatabase()/SQL_ConnectCustom()connect whenever no"vip_test"entry existed indatabases.cfg, blocking the game thread on every (re)connect in that configuration.SQL_TConnect()already falls back to an implicit local SQLite database for an unrecognized config name, so a single async call now covers both the MySQL and SQLite cases.Test plan
"vip_test"databases.cfg entry: confirm it falls back to local SQLite without a main-thread stall andCreateTables()still runs."vip_test"MySQL entry: confirm connect +SET NAMES/SET CHARSETstill run as before.🤖 Generated with Claude Code