Skip to content

Commit

Permalink
feat(MySQL): 添加同步锁以获取数据库连接
Browse files Browse the repository at this point in the history
  • Loading branch information
shulng committed Sep 7, 2024
1 parent d1365c1 commit db60f85
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public MySQL(JavaPlugin javaPlugin) {
}

@Override
public Connection getConnection() throws SQLException {
public synchronized Connection getConnection() throws SQLException {
if (isConnectionValid()) {
return this.connection;
}
Expand Down

0 comments on commit db60f85

Please sign in to comment.