-
Notifications
You must be signed in to change notification settings - Fork 106
feat: add support for scheduled functions to Go client #368
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
Conversation
✔️ Deploy Preview for open-api ready! 🔨 Explore the source changes: f043261 🔍 Inspect the deploy log: https://app.netlify.com/sites/open-api/deploys/61d4190110c54600083c4d17 😎 Browse the preview: https://deploy-preview-368--open-api.netlify.app |
@@ -91,7 +91,7 @@ type DeployOptions struct { | |||
|
|||
files *deployFiles | |||
functions *deployFiles | |||
functionSchedules []models.FunctionSchedule | |||
functionSchedules []*models.FunctionSchedule |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change to pointers here is just so that it matches the FunctionSchedules
type from DeployFiles
without doing any conversion.
@@ -238,10 +238,15 @@ func (n *Netlify) DoDeploy(ctx context.Context, options *DeployOptions, deploy * | |||
} | |||
} | |||
|
|||
if len(schedules) > 0 { | |||
deployFiles.FunctionSchedules = schedules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where we pass the schedules to the deploy options.
@@ -580,7 +585,7 @@ func walk(dir string, observer DeployObserver, useLargeMedia, ignoreInstallDirs | |||
return files, err | |||
} | |||
|
|||
func bundle(functionDir string, observer DeployObserver) (*deployFiles, []models.FunctionSchedule, error) { | |||
func bundle(ctx context.Context, functionDir string, observer DeployObserver) (*deployFiles, []*models.FunctionSchedule, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bundle
and bundleFromManifest
are now receiving the context so that they can acquire a logger and print a debug message.
FunctionSchedules
property to the deploy options when function schedules are detectedscheduled_functions
log field to an existing log message, showing the number of scheduled functions detected for the deploy