diff options
author | g.denis <gantsevdenis@gmail.com> | 2020-03-12 21:45:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-12 13:45:59 -0700 |
commit | 0f3d4602efa2eda4cf5056d237cac36b2cc012ea (patch) | |
tree | 0af0b1d44c6d91b4eeb596559b8ed9387763752d | |
parent | bc7a5d01001df69f9f0c3dfeb94cca92768ab696 (diff) |
Fix: Unable to drop previously connected-to database (#1152)
* close connections + added to authors + changelog
* check conn exists
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | changelog.rst | 1 | ||||
-rw-r--r-- | pgcli/completion_refresher.py | 4 |
3 files changed, 6 insertions, 0 deletions
@@ -105,6 +105,7 @@ Contributors: * BrownShibaDog * George Thomas(thegeorgeous) * Yoni Nakache(lazydba247) + * Gantsev Denis Creator: -------- diff --git a/changelog.rst b/changelog.rst index cc7cf941..59c4f1fd 100644 --- a/changelog.rst +++ b/changelog.rst @@ -11,6 +11,7 @@ Features: Bug fixes: * Fix warning raised for using `is not` to compare string literal +* Close open connection in completion_refresher thread Internal: --------- diff --git a/pgcli/completion_refresher.py b/pgcli/completion_refresher.py index a70d2f2b..cf0879fd 100644 --- a/pgcli/completion_refresher.py +++ b/pgcli/completion_refresher.py @@ -84,6 +84,10 @@ class CompletionRefresher(object): for callback in callbacks: callback(completer) + if not settings.get("single_connection") and executor.conn: + # close connection established with pgexecute.copy() + executor.conn.close() + def refresher(name, refreshers=CompletionRefresher.refreshers): """Decorator to populate the dictionary of refreshers with the current |