Skip to content

Commit

Permalink
add missing close method to mongodb class (#237)
Browse files Browse the repository at this point in the history
This PR adds a close method to the mongo db class, missing so far but useful for some scripts
  • Loading branch information
Theodlz authored Aug 17, 2023
1 parent 62c9c3a commit c5e7d05
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions kowalski/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,14 @@ def update_one(
)
traceback.print_exc()

def close(self):
try:
self.client.close()
return True
except Exception as e:
log(f"Error closing connection: {str(e)}")
return False


def radec_str2rad(_ra_str, _dec_str):
"""
Expand Down

0 comments on commit c5e7d05

Please sign in to comment.