I am migrating some scheduler functions from 1st to 2nd gen. While the documentation talks about passing runtime options to other types of functions like onRequest
and onCall
, I do not see the equivalent for onSchedule
. The first argument is the schedule itself and the second is the handler.
So how do I specify things like vpcConnector and memory?
I do not want to use the setGlobalOptions
function because not everything I want to set should affect all functions globally.
2
Answers
The first argument can be a schedule string but it can also be an object with arguments:
You can find all props available on ScheduleOptions interface wich extends GlobalOptions interface.
See the API documentation. There are two variants of onSchedule. You want the one that takes ScheduleOptions as a first parameter. ScheduleOptions lets you provide the schedule as a property, along with all of the properties inherited from GlobalOptions. GlobalOptions accepts vpcConnector and memory.