Skip to content

Commit

Permalink
Wait 24 hours before deleting a root.
Browse files Browse the repository at this point in the history
  • Loading branch information
scytacki committed Sep 11, 2024
1 parent 2fd2247 commit 3fb3b35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion functions-v2/src/at-midnight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const atMidnight = onSchedule("0 0 * * *", runAtMidnight);
export async function runAtMidnight() {
await cleanFirebaseRoots({
appMode: "qa",
hoursAgo: 6,
hoursAgo: 24,
logger,
dryRun: false,
});
Expand Down
10 changes: 5 additions & 5 deletions functions-v2/test/at-midnight.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ describe("atMidnight", () => {
.toHaveBeenCalledWith("Found 1 roots to delete");
});

test("only clean up firestore roots older than 6 hours", async () => {
test("only clean up firestore roots older than 24 hours", async () => {
await writeFirestoreRoot(Date.now() - HOUR);
await writeFirestoreRoot(Date.now() - 2*HOUR);
await writeFirestoreRoot(Date.now() - 5*HOUR);
await writeFirestoreRoot(Date.now() - 8*HOUR);
await writeFirestoreRoot(Date.now() - 24*HOUR);
await writeFirestoreRoot(Date.now() - 12*HOUR);
await writeFirestoreRoot(Date.now() - 23*HOUR);
await writeFirestoreRoot(Date.now() - 25*HOUR);
await writeFirestoreRoot(Date.now() - 48*HOUR);

await runAtMidnight();

Expand Down

0 comments on commit 3fb3b35

Please sign in to comment.