Skip to content

Conversation

@clairep94
Copy link
Contributor

@clairep94 clairep94 commented May 10, 2025

Original Issue:

#831

Changes:

  • Memoizes getCuratedSketches
  • Refactors getSketch(id) to first check in the memoized getCuratedSketches results for an item with matching visualID first, then only calls OpenProcessing API for the individual sketch Id if no memoized item is found
  • Destructures properties from getSketch on the SketchLayout -- I thought this increased legibility, but happy to take this out

Notes:

I took a look at removing the call to /api/code which is in getSketchSize

  • It seems like /code is used just to get the width and height properties of a sketch
  • If it is possible to add width and height to the data for both getCuratedSketches and getSketch(id), I'll make a followup PR to refactor and eliminate the extra API call to /api/code as well!

@clairep94 clairep94 changed the title Resolves #831: Builds hitting rate limits on Open Processing API Resolves #831: Reduce calls to Open Processing API to prevent hitting rate limit errors May 10, 2025
@clairep94 clairep94 changed the title Resolves #831: Reduce calls to Open Processing API to prevent hitting rate limit errors Resolves #831: Reduces calls to Open Processing API to prevent hitting rate limit errors May 10, 2025
@ksen0 ksen0 merged commit 13318ef into processing:main May 12, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants