Extending time limit of lambda-functions locally?

Hi team,

Is it possible to extend the timeout of our functions from 10s to 26s locally? Our async processes have enough time to work in production but timeout locally because of the 10s limit.

Thank you.

Site name: trybree

howdy @akang10 !

I’m guessing you’re using the CLI (netlify dev to develop locally) - true?

I believe that as long as you are working locally, from a clone of the repo that has been netlify link'd to a site here, we’ll pull down the timeout we have set on our side. I suppose that you are doing that, but could you confirm? If you are, I’ll get a bug filed for us.

Regardless, if that isn’t working, you can certainly hardwire a different value - it’s hardcoded in the code here: cli/dev.js at main · netlify/cli · GitHub

Hey @fool thanks for the quick response here. We are using netlify dev to boot up locally. We have 26s enabled in production - are you saying we should have it enabled locally as well?

If this is the case, is this a bug on your end? Could you clarify how we can hardcode (where the SYNCHRONOUS_FUNCTION_TIMEOUT / file is located) a different value on our end in the meantime?

Thanks!

OK, sounds like there might be a missing feature. Could you please confirm that you’ve used netlify link to link the CLI with the trybree site? (e.g. you can run netlify deploy from the same directly, without specifying which site you are deploying?). Once I am sure that you have, I’ll get that issue filed for us and link it here for you to follow.

To unblock you for today I was trying to describe that you can edit the code that I linked to and use the edited copy. I suppose you could either:

  • clone the repo and edit and then build/install a modified copy of the node module (not sure how best to do that, sounds complicated)
  • or you could edit the installed node module (which you can probably locate by running: which netlify from the same place you’d run netlify dev and editing the script), where there will still be that hardcoded SYNCHRONOUS_FUNCTIONS_TIMEOUT = 10) - and you can change it to be 26 to match your config at Netlify, or 24 if you want to give yourself 2 seconds of headroom, or whatever :slight_smile:

Hey @fool it looks like we weren’t doing netlify link prior to doing netlify dev. It looks like the timeout is set to 26s now. Could you explain how that works since we were previously using netlify dev without issue?

Thanks for clearing this up!

Hi @akang10,

When you run netlify link, a few things happen:

  • a call is made to netlify API, and the settings for the site are retrieved

  • those settings are then stored in a state.json file locally

You only need to run netlify link when you need to sync with the settings in the UI.

Let us know if you have any questions. Thanks!