Skip to content

feat: scheduler fn support #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2023
Merged

feat: scheduler fn support #60

merged 1 commit into from
Apr 14, 2023

Conversation

Salakar
Copy link
Member

@Salakar Salakar commented Apr 13, 2023

Testing

Deployed the following sample:

from firebase_functions import scheduler_fn


@scheduler_fn.on_schedule(
    schedule="* * * * *",
    timezone=scheduler_fn.Timezone("America/Los_Angeles"),
)
def example(event: scheduler_fn.ScheduledEvent) -> None:
    print("Hello from scheduled function!")
    print(event.job_name)
    print(event.schedule_time)

Deployment is successful:

image

image

Schedule runs and prints:
image

Copy link
Collaborator

@taeold taeold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nits

If invoked manually, this field is None.
"""

schedule_time: _dt.datetime
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit* This is great! I'd been fine with string, but parsing it sounds extra helpful!

@taeold taeold merged commit 44ed9a2 into firebase:main Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants