feat: Added global database management features and optimized the user authentication process#2
Conversation
…r authentication process Rewrote the user service to support global database instances Removed database configuration checks to ensure the authentication route is always available Added the AGENTS.md file to document build instructions Updated frontend dependency versions
…tabase switching Remove explicit database checks from the router and instead retrieve the database dynamically via the `getDB` method Add the `SetDB` method to allow runtime updates to the database connection Simplify the network service code structure and remove redundant comments ci(workflow): Remove the pull request trigger condition for the main branch
…rations Add a `sync.RWMutex` to protect database connection operations in the Network Service, preventing data race conditions caused by concurrent access
…or database initialization Added a check in NetworkService to verify that the ZeroTier client has not been initialized Ensure that the database connection is closed if database initialization fails
Ensure that the connection is properly closed if database initialization fails to prevent resource leaks
…ng up the global database Before setting up a new global database connection, check for and close any existing connections to prevent resource leaks Fix incorrect indentation in server_initializer.go
…ng database reconfiguration When reconfiguring the database, ensure that the old database connection is closed first Adjusted the order of global database connection settings to prevent the service from using the old connection
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.
Rewrote the user service to support global database instances
Removed database configuration checks to ensure the authentication route is always available
Added the AGENTS.md file to document build instructions
Updated frontend dependency versions