Background Function Unnecessary Timeout


I am using Background Functions to generate AI responses. When the response is done generating, the function can stop. Is this just a simple return or something else?

Currently, the functions work great, and there is no issue on the client, but I noticed a bunch of timeout errors in the logs (one for each AI response, 15 minutes later).

So I don’t know if this will actually affect anything, but I don’t like seeing the red errors lol.

Any help is much appreciated!

Background functions aren’t designed to run/exist forever.

As stated in the Background Functions overview

…serverless functions that run for up to 15 minutes…

Yes I understand this. I’m just asking how to terminate the function before the timeout.

It terminates when the awaited function is finished.