Ross Coundon
11/05/2021, 10:56 PMdatasetIds.forEach((datasetId) => {
const populatorFunction = new sst.Function(this, `populatorFunction-${datasetId}`, {
handler: 'src/main/handler/populator.startLookingForMissingUrls',
environment: {
OFSC_INSTANCE: datasetId,
},
});
new sst.Cron(this, `OmwPopulatorCron=${datasetId}`, {
schedule: process.env.POPULATOR_CRON,
job: {
function: populatorFunction,
},
});
})
So you can see that the OFSC_INSTANCE env var is set according to the value from a string array defined earlier.
When running this using sst start
I'm seeing some odd behaviour regarding the env var OFSC_INSTANCE.
On the first kick off of each lambda via the cron, sometimes the value of the env var is correct. However, after that, both lambdas have the same value for that env var. Sometimes they're the same on first start too.
Is there something about the local execution environment that would env vars end up getting shared between invocations of shared code?thdxr
11/06/2021, 12:16 AM