In my defaultFunctionProps for all my routes I hav...
# help
e
In my defaultFunctionProps for all my routes I have the following in order for things to work properly with sequelize and mysql :
Copy code
bundle: {
          externalModules: ['pg-hstore'],
          nodeModules: ['mysql2']
        },
Now my question is how do I do the equivalent for a cron job definition ? I tried this without success :
Copy code
new Cron(this, "Cleanup", {
      schedule: "cron(0 9 * * ? *)", 
      job: "src/jobs/cleanup.main",
      enableLiveDev: false,
      bundle: {
        externalModules: ['pg-hstore'],
        nodeModules: ['mysql2']
      },
    });
Also is there any way to set this in a "global" way so that I don't have to repeat it everywhere ? Thanks !
b
App
has
setDefaultFunctionProps
which will allow you to set default config on to ALL sst.Functions in the application. Which version of sst are you using?
e
0.69.0
b
If you don't go the
setDefaultFunctionProps
route then I think you'll need to change your job definition to be
FunctionProps
.
CronProps
doesn't appear to extend it so those additional values aren't going to be processed by sst.
e
Thanks for your help in pointing me in a viable direction @Brinsley, I actually went with the stack.setDefaultFunctionProps