[go: nahoru, domu]

Skip to content

Commit

Permalink
Respect TimeZone in scheduled functions (#3434)
Browse files Browse the repository at this point in the history
* Copy TimeZone from spec to Job

* Add regression test
  • Loading branch information
inlined committed Jun 1, 2021
1 parent 3e4f7e9 commit 07f3195
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/deploy/functions/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ export function toJob(schedule: ScheduleSpec, appEngineLocation: string): clouds
name: scheduleName(schedule, appEngineLocation),
schedule: schedule.schedule!,
};
proto.copyIfPresent(job, schedule, "retryConfig");
proto.copyIfPresent(job, schedule, "timeZone", "retryConfig");
if (schedule.transport === "https") {
throw new FirebaseError("HTTPS transport for scheduled functions is not yet supported");
}
Expand Down
2 changes: 2 additions & 0 deletions src/test/deploy/functions/backend.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ describe("Backend", () => {
backend.toJob(
{
...SCHEDULE,
timeZone: "America/Los_Angeles",
retryConfig: {
maxDoublings: 2,
maxBackoffDuration: "20s",
Expand All @@ -652,6 +653,7 @@ describe("Backend", () => {
).to.deep.equal({
name: "projects/project/locations/appEngineLocation/jobs/firebase-schedule-id-region",
schedule: "every 1 minutes",
timeZone: "America/Los_Angeles",
retryConfig: {
maxDoublings: 2,
maxBackoffDuration: "20s",
Expand Down

0 comments on commit 07f3195

Please sign in to comment.