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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

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
48

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

122–124

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
122–124

ah yes, that'd be more readable.