Timeouts on Netlify
See original GitHub issueHi,
we’ve updated to the latest version and since then our functions on Netlify time out. Exactly on the line where we connect to redis, no exceptions or anything just a timeout after 10 seconds.
Locally via netlify dev
everything works.
Any idea what changed that could cause this?
const { Redis } = require("@upstash/redis");
const redis = new Redis({
url: process.env.UPSTASH_REDIS_REST_URL,
token: process.env.UPSTASH_REDIS_REST_TOKEN,
});
module.exports.handler = async (event, context) => {
// only allow GET requests
if (event.httpMethod !== "GET") {
return {
statusCode: 405,
body: JSON.stringify("Method not allowed."),
};
}
try {
const siteId = event.path.replace("/some-path/", "").split("/")[0];
console.log('blah'); // works...
const data = await redis.get(siteId); // timeout after 10 seconds
console.log('nope'); // never logs...
...
...
Issue Analytics
- State:
- Created a year ago
- Comments:10
Top Results From Across the Web
Function timeout increase - Netlify Support Forums
Our webhook usually completes in under 10 seconds, but every month we have a couple that time out, causing us to lose data....
Read more >Request timeout - Admin - Netlify Support Forums
How can I increase the function timeout of my sites? Ideally, we would want our timeouts to be maxed on all our sites...
Read more >Serverless-http timeouts on netlify functions local enviroment
Anyone has good idea? All serverless function time out after 10 seconds by default (an increase to 26 seconds is possible.) Serverless ...
Read more >Netlify Function Timeout after 10 seconds when published
Hi Netlify Community! I'm trying to make a query to Firebase firestore with in a Netlify function which works perfectly fine when developing...
Read more >Function timeout increase - Netlify Support Forums
If you upgrade to the Pro Team plan or above, please let us know and we'll be able to increase the Functions timeout...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’re a rockstar @chronark 😃
Thanks very much, appreciate you.
The only difference between the two is
../with-fetch
has an additional importImporting it while you are using node18 works without issues, as it only polyfills if
fetch
is not available. So I doubt it will cause troubles, but of course i can not vouch for another dependency.