connection updates
This commit is contained in:
@@ -902,6 +902,9 @@ final class DatabaseModel: ObservableObject {
|
||||
recordQuery(statement, profile: profile, database: activeDB, succeeded: true, detail: status)
|
||||
}
|
||||
} catch {
|
||||
// An old connection must not overwrite the newly selected
|
||||
// connection's state when its request finishes later.
|
||||
guard selectedID == profile.id else { return }
|
||||
status = "Error"
|
||||
result = QueryResult(message: error.localizedDescription)
|
||||
if !listingDatabases {
|
||||
|
||||
@@ -523,7 +523,11 @@ enum NativeMySQLRunner {
|
||||
}.value
|
||||
}
|
||||
|
||||
// Connection shutdown may wait behind a slow network operation on the
|
||||
// session's serial queue. Never make the SwiftUI main thread wait for it.
|
||||
static func disconnect(profileID: UUID) {
|
||||
PersistentMySQLSessions.shared.disconnect(profileID: profileID)
|
||||
Task.detached(priority: .utility) {
|
||||
PersistentMySQLSessions.shared.disconnect(profileID: profileID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user