use new formula to calc ivl in getRetentionWarning (#2911)

* use new formula to calc ivl in getRetentionWarning

* format

* Use consistent casing (dae)
This commit is contained in:
Jarrett Ye 2023-12-27 10:26:58 +08:00 committed by GitHub
parent 7e66976cd1
commit e68430eec2

View file

@ -64,7 +64,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
}
function getRetentionWarning(retention: number): string {
const days = Math.round(9 * 100 * (1.0 / retention - 1.0));
const decay = -0.5;
const factor = 0.9 ** (1 / decay) - 1;
const stability = 100;
const days = Math.round(
(stability / factor) * (Math.pow(retention, 1 / decay) - 1),
);
if (days === 100) {
return "";
}