---
title: "Comment by Hayrullah Kar on \"Google Sheets custom function errors: why =MYFUNC() breaks at scale, and the one-call-per-range fix\" | Hashnode"
description: "Checking the time budget before each fetchAll batch, with room left for one slow batch, is a careful piece of design. One case it doesn't cover: a SKU that the"
url: "https://hashnode.com/posts/google-sheets-custom-function-errors-why-myfunc-breaks-at-scale-and-the-one-call-per-range-fix/6af44312faf82077fc5fc737/comment/6af5fe15fc3aa984e9a0012f"
---

[Discussion](https://hashnode.com/posts/google-sheets-custom-function-errors-why-myfunc-breaks-at-scale-and-the-one-call-per-range-fix/6af44312faf82077fc5fc737)

Comment [Google Sheets custom function errors: why =MYFUNC() breaks at scale, and the one-call-per-range fix](https://hashnode.com/posts/google-sheets-custom-function-errors-why-myfunc-breaks-at-scale-and-the-one-call-per-range-fix/6af44312faf82077fc5fc737)

[Hayrullah Kar](https://hashnode.com/@magesheet)

[2h ago](https://hashnode.com/posts/google-sheets-custom-function-errors-why-myfunc-breaks-at-scale-and-the-one-call-per-range-fix/6af44312faf82077fc5fc737/comment/6af5fe15fc3aa984e9a0012f)

Checking the time budget before each `fetchAll` batch, with room left for one slow batch, is a careful piece of design. One case it doesn't cover: a SKU that the endpoint answers with a 404, or without an `available` field, is never cached. It shows 'Not fetched yet' forever, which reads as 'wait a bit'. Every recalculation spends a request on it again, which eats into the 20-second budget meant for the SKUs that can succeed. For 404s specifically (not 5xx), you could cache a short-lived 'not found' marker, say for an hour, and return 'Unknown SKU' instead. That stops the repeat requests and tells the user something they can act on.
