Page MenuHomeSoftware Heritage

backend: add cache expiration management functions
ClosedPublic

Authored by seirl on Sep 8 2017, 6:08 PM.

Details

Diff Detail

Repository
rDVAU Software Heritage Vault
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 1001
Build 1326: arc lint + arc unit

Event Timeline

refactor using fake_cook method

zack requested changes to this revision.Sep 13 2017, 11:17 AM
zack added a subscriber: zack.

Looks good.

Except for some naming nits (which are totally debatable!) and missing docstrings (which are not ☺).

sql/swh-vault-schema.sql
27

Sorry to nit about naming, but I don't quite like "permanent" because, AFAICT, it is not really permanent, as in, forever. We might change the boolean in the future to False, and the vault remains a cache thingie anyhow.
In a similar context in Debsources, I've used "sticky". What do you think of it?
Worth changing for "permanent"?

swh/vault/backend.py
277

please add a short docstring here explaining this is the low-level expiry method, used by the other top-level ones

294

how about "cache_expire_recent" here?
"count" doesn't really convey the policy for picking the "N", once "N" is defined

Also, please add a docstring here explaining the policy behind the cache expiry done by this method.

300

ditto: docstring missing here explaining the policy implemented by this expiry method

This revision now requires changes to proceed.Sep 13 2017, 11:17 AM
This revision is now accepted and ready to land.Sep 14 2017, 10:34 AM