Skip to content

Commit

Permalink
isort
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenain committed Aug 30, 2024
1 parent d361f7f commit c8b6d64
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/nectarchain/dqm/db_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import transaction
from BTrees.OOBTree import OOBTree

Check warning on line 2 in src/nectarchain/dqm/db_utils.py

View check run for this annotation

Codecov / codecov/patch

src/nectarchain/dqm/db_utils.py#L2

Added line #L2 was not covered by tests
from ZEO import ClientStorage
from ZODB import DB

Expand All @@ -17,7 +18,7 @@ def __init__(self, read_only=True):
def insert(self, key=None, value=None):
if key is not None and value is not None:
try:
self.root[key] = value
self.root[key] = OOBTree(value)

Check warning on line 21 in src/nectarchain/dqm/db_utils.py

View check run for this annotation

Codecov / codecov/patch

src/nectarchain/dqm/db_utils.py#L21

Added line #L21 was not covered by tests
return True
except AttributeError:
return False
Expand Down

1 comment on commit c8b6d64

@jlenain
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Use OOBTree to write into ZODB. This allows more efficient write access to the DB, and reduces the needed storage by a factor 4!

Please sign in to comment.