Hey guys ... need help with a quick question.... T...
# help
c
Hey guys ... need help with a quick question.... Trying to setup a new Cron that kicks off every day, once a day. The job/function is in c#, so needed runtime would be dotnet3.1 .... is htis runtime supported within Crons? Tried finding reference to it, but getting a few ambiguous results ....
r
As far as a I know, the cron isn't related to the runtime. You just define the 'job' that you want it to call. So the handler is defined like any other, so if SST supports the runtime, it should be ok E.g.
Copy code
const someCron = new sst.Cron(this, 'SomeCron', {
      schedule: 'rate(5 minutes)',
      job: {
        handler: 'src/main/handlers/populator.doSomething',
        environment,
      },
    });
c
Yeah, it doesn't shout at me immediately when I have the construct for the Cron, only when it starts synthesizing the app. my Cron for reference...
Copy code
new Cron(this, "carlos", {
      schedule: rate(5 minutes),
      job: {
        handler: lambda,
        role: lambdaRole,
        runtime: Runtime.DOTNET_CORE_3_1,
        srcPath: ReferenceStack.SRC_LOCATION,
        memorySize: 512,
      },
)
r
What error is it giving you when synthesizing?
c
Error: The specified runtime is not supported for sst.Function. Only NodeJS, Python, and Go runtimes are currently supported. Which is kind of self explanatory, but like I mentioned earlier, I was getting ambiguous results when researching, so I thought I'd ask some experts here for help (as I'm kind of new to SST)
r
Maybe dotnet3.1 isn't a support runtime. Frank or Jay can confirm when they wake up. In the meantime, are you able to just create a function inside an API Gateway with that config?
c
Yeah, we have other c# lambda's that run through API gateway that are triggered and work fine, it's just when creating this Cron that it seems to not like it ... which is what was weird ....
but thanks for the help / advice .... Maybe Frank can confirm this 100% when he's up, and then I can find another way 🙂
f
Hi @Carlos Ribeiro dotnet3.1 is not supported yet. A couple of questions: • what build commands are you using to build your C# Lambda functions currently? • are you building inside a docker container? • are you using Nuget as the package manager? Let me know and I can add support for it today or tmr.
c
Hi @Frank Apologies for the late response, but I was unwell over the weekend. To answer your questions: 1. dotnet lambda package --project-location ./location --configuration Release --framework netcoreapp3.1 --output-package .dotnet/bin/lambda.zip 2. No, we are not using a docker container 3. Yes, we use Nuget as the package manager. Many thanks for your help.
f
Thanks @Carlos Ribeiro. Hope you are feeling better now!
Let me put something in this week. I will keep you posted.
c
Thanks Frank.
Hi @Frank, just a quick check-in to see if this can be expected by the end of the week still? 😊 (No pressure, just wanting to manage my expectations)
f
Hey @Carlos Ribeiro, yup working on it! I will try to have something you can playaround around with by today/tmr.
c
Thanks @Frank, appreciate the update.
f
Hey @Carlos Ribeiro, the schedule got pushed back a bit. I will get it in this week. If there’a deadline or something u have to meet on ur side, let me know!
Sorry for the delay man!
c
Hey @Frank, not a problem man, appreciate the update. If I could get it this week, that would be great. Have a great day and week ahead 🙂
f
Hey @Carlos Ribeiro, sorry for the delay. C# was a bit trickier than anticipated 🤪 Glad @thdxr was there to guide me through the process.
Give it a try! Let me know if it works with your project.
c
Hey @Frank… not a problem man, I know you guys are busy and trying to do your best. Really appreciate you guys getting this in so quickly too, so thanks for that!! We’ll give it a try in the next week or so! Have an awesome day!!