diff --git a/shared/datastore/src/get.py b/shared/datastore/src/get.py index 6c4cc69..09ce2c6 100644 --- a/shared/datastore/src/get.py +++ b/shared/datastore/src/get.py @@ -38,5 +38,7 @@ def get( print_exc() raise exc finally: - response.close() - response.release_conn() + # close connection if established + if 'response' in locals(): + response.close() + response.release_conn()