Files
gristlabs_grist-core/app/server/lib
Alex Hall ec8460b772 (core) Prune snapshots outside the window in product features
Summary:
- Add a method `getSnapshotWindow` to `IInventory` and `DocSnapshotInventory`. It returns a `SnapshotWindow`, which represents a duration of time for which we keep backups for a particular document.
- `DocSnapshotPruner` calls this method and passes the window to `shouldKeepSnapshots` to determine which document versions have fallen outside the window and should be pruned.
- The implementation passed to `DocSnapshotInventory` uses a new method `getDocProduct` in `HomeDBManager` which directly returns the `Product` associated with a document, given only the document ID. Other methods in `HomeDBManager` require passing more information, especially about a user, but `DocSnapshotPruner` only knows about document IDs.

Test Plan: Added a test for `getDocProduct` and a test for `DocSnapshotPruner` where `getSnapshotWindow` is specified.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D3322
2022-03-18 18:48:14 +02:00
..
2022-02-19 09:46:49 +00:00
2022-02-19 09:46:49 +00:00
2022-03-14 17:51:10 +01:00
2022-03-14 17:51:10 +01:00
2020-07-21 20:39:10 -04:00
2022-02-19 09:46:49 +00:00
2022-02-19 09:46:49 +00:00
2022-02-19 09:46:49 +00:00
2022-02-19 09:46:49 +00:00
2021-12-07 17:09:58 +02:00
2021-12-07 17:09:58 +02:00
2022-02-19 09:46:49 +00:00
2022-03-12 14:34:46 -08:00
2020-07-21 20:39:10 -04:00
2020-07-21 20:39:10 -04:00
2020-07-21 20:39:10 -04:00
2020-07-21 20:39:10 -04:00
2022-02-19 09:46:49 +00:00
2022-02-19 09:46:49 +00:00
2022-03-12 14:34:46 -08:00
2020-07-21 20:39:10 -04:00
2020-07-21 20:39:10 -04:00
2020-07-21 20:39:10 -04:00
2021-12-07 17:09:58 +02:00
2022-01-13 11:10:17 +01:00