mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Ready for 1.1.2
This commit is contained in:
@@ -31,7 +31,14 @@ export async function enforceRetentionGFS(databaseId: string, gfsSettings: {
|
||||
});
|
||||
|
||||
// WEEKLY
|
||||
const weekStartDates = Array.from({length: gfsSettings.weekly}, (_, i) => startOfWeek(subWeeks(now, i)));
|
||||
// const weekStartDates = Array.from({length: gfsSettings.weekly}, (_, i) => startOfWeek(subWeeks(now, i)));
|
||||
// weekStartDates.forEach((weekStart) => {
|
||||
// const backupOfWeek = backups.find(
|
||||
// (b) => b.createdAt >= weekStart && b.createdAt < subWeeks(weekStart, -1)
|
||||
// );
|
||||
// if (backupOfWeek) toKeep.add(backupOfWeek.id);
|
||||
// });
|
||||
const weekStartDates = Array.from({length: gfsSettings.weekly}, (_, i) => startOfWeek(subWeeks(now, i), { weekStartsOn: 1 }));
|
||||
weekStartDates.forEach((weekStart) => {
|
||||
const backupOfWeek = backups.find(
|
||||
(b) => b.createdAt >= weekStart && b.createdAt < subWeeks(weekStart, -1)
|
||||
@@ -39,6 +46,9 @@ export async function enforceRetentionGFS(databaseId: string, gfsSettings: {
|
||||
if (backupOfWeek) toKeep.add(backupOfWeek.id);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
// MONTHLY
|
||||
const monthStartDates = Array.from({length: gfsSettings.monthly}, (_, i) => startOfMonth(subMonths(now, i)));
|
||||
monthStartDates.forEach((monthStart) => {
|
||||
|
||||
Reference in New Issue
Block a user