Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEVOPS-1955 Lazy Load Mongo Client #119

Merged
merged 12 commits into from
Jun 24, 2024
Merged

Conversation

bio-boris
Copy link
Contributor

@bio-boris bio-boris commented Jun 21, 2024

6/21/2024 3:50:34 PM1719003034.428176 INFO: start fetching handles
6/21/2024 3:50:34 PM1719003034.428512 INFO: start querying MongoDB
6/21/2024 3:50:34 PM/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py:2347: UserWarning: MongoClient opened before fork. May not be entirely fork-safe, proceed with caution. See PyMongo's documentation for details: https://pymongo.readthedocs.io/en/stable/faq.html#is-pymongo-fork-safe
6/21/2024 3:50:34 PM  return self._read() if self._is_read else self._write()

After this PR, this error no longer occurs

  • Updates 4dba659 to lazy load
  • Fixes formatting errors from lintly
  • Fixes tests

Copy link

codecov bot commented Jun 21, 2024

Codecov Report

Attention: Patch coverage is 82.45614% with 10 lines in your changes missing coverage. Please review.

Project coverage is 84.13%. Comparing base (852313d) to head (ec26804).

Files Patch % Lines
lib/AbstractHandle/Utils/MongoUtil.py 82.45% 10 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #119      +/-   ##
===========================================
+ Coverage    83.70%   84.13%   +0.43%     
===========================================
  Files            5        5              
  Lines          405      416      +11     
===========================================
+ Hits           339      350      +11     
  Misses          66       66              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lintly has detected code quality issues in this pull request.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lintly has detected code quality issues in this pull request.

@bio-boris bio-boris changed the title Change Log Level to Debug DEVOPS-1954 Change Log Level to Debug Jun 21, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lintly has detected code quality issues in this pull request.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lintly has detected code quality issues in this pull request.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lintly has detected code quality issues in this pull request.

@bio-boris bio-boris changed the title DEVOPS-1954 Change Log Level to Debug DEVOPS-1954 Lazy Load Mongo Client Jun 21, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lintly has detected code quality issues in this pull request.

@@ -66,10 +66,15 @@ def test_get_collection(self):
def test_init_ok(self):
self.start_test()
class_attri = [
'mongo_host', 'mongo_port', 'mongo_database', 'handle_collection',
'hid_counter_collection',
'mongo_host', 'mongo_port', 'mongo_database', '_handle_collection',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to rewrite tests here

)

@property
def handle_collection(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added property here

return self._handle_collection

@property
def hid_counter_collection(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added property here

@bio-boris bio-boris changed the title DEVOPS-1954 Lazy Load Mongo Client DEVOPS-1955 Lazy Load Mongo Client Jun 21, 2024
Copy link
Collaborator

@Tianhao-Gu Tianhao-Gu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code changes looks good. Do we need to bump versions/ update release notes, etc for prod release?

@bio-boris
Copy link
Contributor Author

Thanks @Tianhao-Gu . I updated the release notes to include this change. I don't think we need to bump the version as we only every deployed 1.0.5 anywhere.

@Tianhao-Gu
Copy link
Collaborator

Thanks @Tianhao-Gu . I updated the release notes to include this change. I don't think we need to bump the version as we only every deployed 1.0.5 anywhere.

💯

@Tianhao-Gu Tianhao-Gu merged commit 17a8210 into develop Jun 24, 2024
12 of 13 checks passed
@Tianhao-Gu Tianhao-Gu deleted the change_log_level_to_debug branch June 24, 2024 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants