Reputation: 365
I'm trying to run a function every day at 00.00 - However, when deploying the function I'm getting this error from Firebase:
Failed to create scheduler job projects/myProject/locations/europe-west1/jobs/firebase-schedule-checkCourseForNewClientProgram-us-central1: HTTP Error: 400, Schedule or time zone is invalid.
I've tried setting the timeZone() to "Europe/Copenhagen", that didn't work. I've tried setting the region() to "europe-west1", which didn't work either. I've also tried with other formats in the "schedule()" function, but every time I'm getting the error when deploying :(
export const checkCourseForNewClientProgram = functions.pubsub.schedule("every day 00:00").onRun(async (context) => {
......
});
What am I doing wrong?
Upvotes: 0
Views: 1135
Reputation: 81454
The problem is with the schedule and not the time zone.
Every day at midnight:
functions.pubsub.schedule('0 0 * * *')
Upvotes: 2