diff options
-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 |