Skip to content

Commit

Permalink
try to increase timeout to 30 minutes
Browse files Browse the repository at this point in the history
According to the FB docs a schedule function like this is triggered by
an http request. And http request functions can run up to 60 minutes.
  • Loading branch information
scytacki committed Sep 13, 2024
1 parent 36b3ee1 commit 0cfe1f1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion functions-v2/src/at-midnight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@ import * as logger from "firebase-functions/logger";
// type errors.
import {cleanFirebaseRoots} from "../../shared/clean-firebase-roots";

export const atMidnight = onSchedule("0 7 * * *", runAtMidnight);
export const atMidnight = onSchedule(
{
// Let the function run for 30 minutes.
// From early testing it looks like the function can delete 500 qa roots
// every 5 minutes.
timeoutSeconds: 1800,
// Run the function at 7am UTC or 12am PDT
schedule: "0 7 * * *",
},
runAtMidnight
);

// This function is split out so it can be tested by Jest. The
// firebase-functions-test library doesn't support wrapping onSchedule.
Expand Down

0 comments on commit 0cfe1f1

Please sign in to comment.