Page MenuHomeSoftware Heritage

storage.in_memory: Use in-memory objstorage to store contents
ClosedPublic

Authored by anlambert on Dec 11 2018, 10:58 AM.

Details

Summary

In order to be more compliant with the swh stack and ease the
writing of tests, use the in-memory objstorage for storing contents
in the in-memory storage implementation.

Diff Detail

Repository
rDSTO Storage manager
Branch
in-memory-objstorage
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 2967
Build 3787: tox-on-jenkinsJenkins
Build 3786: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Dec 11 2018, 2:40 PM
This revision was automatically updated to reflect the committed changes.
swh/storage/in_memory.py
49

It would make more sense to use a config dict here, like the pg storage.

123–125

Instead of continue, put the yield in an else clause (try blocks accept an else close that runs if no exception was raised).

Sorry @vlorentz, I merged that diff before seeing your comments.

It would make more sense to use a config dict here, like the pg storage.

We can still add it when we will have a use case to use a non-memory objstorage
with a in-memory storage.

Instead of continue, put the yield in an else clause (try blocks accept an else close that runs if no exception was raised).

In fact I reused the implementation from storage.py so this should also be changed in it.

swh/storage/in_memory.py
123–125

ah yes, that'd be more readable.