Feat: increase function execution time #179
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Code changes to increase the duration time on the function level. Only the API function handling the update of stale ENS entries will have a duration above the default 15 seconds on Vercel.
The reason is that, looking at the logs, the call for the ENS graphQL takes a considerable portion of that duration limit
varying between 7 ~ 11 s, plus the duration of avatar text checks on-chain may take around 4s ~ 6s passing the limit of 15s.
These times are based on the current 742 entries marked as stale and needed to be checked. The graphQL query to ENS is a single call passing all the addresses of interest, so not much space for optimisation in that end (based on the graph docs). So my assumption is more related to where the API function is running and the location of the ENS graphQL (Powered by TheGraph). I will add a few screenshots regarding the logs.
PS: Currently, our ENS storage has replicas in US / EU / APAC
Screenshots
First try (504 failure)
Second try (504 failure)
Third try (200 ok)