Luzifer / ots

One-Time-Secret sharing platform with a symmetric 256bit AES encryption in the browser
https://ots.fyi
Apache License 2.0
470 stars 69 forks source link

Add periodic in-memory store pruner #200

Closed jimmypw closed 1 month ago

jimmypw commented 1 month ago

Implement better memory management for the in memory store.

Currently secrets only get deleted once they are read while still valid or attempted to be read once expired. This change implements a go routine that periodically iterates over secrets held in memory and if the secret is expired, deletes it. This will lead to better memory efficiency as expired secrets without any desire to be read won't linger in memory indefinitely.

Luzifer commented 1 month ago

Thanks for adding the cleanup! Though the in-mem store should only be used for testing, it's good to have it properly managed.