diff --git a/functions-v2/src/at-midnight.ts b/functions-v2/src/at-midnight.ts index e4c8cef36..ee6b60d36 100644 --- a/functions-v2/src/at-midnight.ts +++ b/functions-v2/src/at-midnight.ts @@ -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.