Skip to content

Commit 1fbd979

Browse files
author
charlesgauthereau
committed
Ready for 1.1.2
1 parent 4e06d2b commit 1fbd979

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/lib/tasks/database/retention-gsf.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,24 @@ export async function enforceRetentionGFS(databaseId: string, gfsSettings: {
3131
});
3232

3333
// WEEKLY
34-
const weekStartDates = Array.from({length: gfsSettings.weekly}, (_, i) => startOfWeek(subWeeks(now, i)));
34+
// const weekStartDates = Array.from({length: gfsSettings.weekly}, (_, i) => startOfWeek(subWeeks(now, i)));
35+
// weekStartDates.forEach((weekStart) => {
36+
// const backupOfWeek = backups.find(
37+
// (b) => b.createdAt >= weekStart && b.createdAt < subWeeks(weekStart, -1)
38+
// );
39+
// if (backupOfWeek) toKeep.add(backupOfWeek.id);
40+
// });
41+
const weekStartDates = Array.from({length: gfsSettings.weekly}, (_, i) => startOfWeek(subWeeks(now, i), { weekStartsOn: 1 }));
3542
weekStartDates.forEach((weekStart) => {
3643
const backupOfWeek = backups.find(
3744
(b) => b.createdAt >= weekStart && b.createdAt < subWeeks(weekStart, -1)
3845
);
3946
if (backupOfWeek) toKeep.add(backupOfWeek.id);
4047
});
4148

49+
50+
51+
4252
// MONTHLY
4353
const monthStartDates = Array.from({length: gfsSettings.monthly}, (_, i) => startOfMonth(subMonths(now, i)));
4454
monthStartDates.forEach((monthStart) => {

0 commit comments

Comments
 (0)