1
1
mirror of https://github.com/dbcli/pgcli.git synced 2024-09-11 13:56:36 +03:00

Fix: Unable to drop previously connected-to database (#1152)

* close connections + added to authors + changelog

* check conn exists
This commit is contained in:
g.denis 2020-03-12 21:45:59 +01:00 committed by GitHub
parent bc7a5d0100
commit 0f3d4602ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

@ -105,6 +105,7 @@ Contributors:
* BrownShibaDog * BrownShibaDog
* George Thomas(thegeorgeous) * George Thomas(thegeorgeous)
* Yoni Nakache(lazydba247) * Yoni Nakache(lazydba247)
* Gantsev Denis
Creator: Creator:
-------- --------

View File

@ -11,6 +11,7 @@ Features:
Bug fixes: Bug fixes:
* Fix warning raised for using `is not` to compare string literal * Fix warning raised for using `is not` to compare string literal
* Close open connection in completion_refresher thread
Internal: Internal:
--------- ---------

View File

@ -84,6 +84,10 @@ class CompletionRefresher(object):
for callback in callbacks: for callback in callbacks:
callback(completer) 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): def refresher(name, refreshers=CompletionRefresher.refreshers):
"""Decorator to populate the dictionary of refreshers with the current """Decorator to populate the dictionary of refreshers with the current