dronefly-garden / dronefly

Red Discord Bot V3 cogs for naturalists.
Other
16 stars 3 forks source link

place/project list: Always include names in the list #142

Closed synrg closed 3 years ago

synrg commented 3 years ago

Names of places & projects should always be shown in place list and project list. Currently, place & project names are only shown if cached. Uncached names are shown as place/project id#s instead. The concern that originally drove this decision, namely, to avoid hammering the API with a lot of requests at once, is no longer an issue with these two advances in how we could be using the API more efficiently:

  1. Both the place and project API calls that we currently use to populate each page of the display can accept multiple place & project IDs in a single call, up to however many can be fit into a single request.
    • The exact maximum should be determined by testing, as the API doc doesn't say, but 500 is a reasonable guess, as other calls that don't place huge demands on elasticsearch are capped at 500. This seems like that sort of use case.
  2. Also, we recently revamped the API rate-limiting so that it can handle bursts of API requests via the aiolimiter package (see https://github.com/mjpieters/aiolimiter )
    • i.e. no longer a big deal if we do need > 500 at a time (or whatever we determine the upper limit is), as multiple requests can be sent back-to-back within a single command so long as there is still capacity left in the limiter and the user will hardly notice any delay, while not impacting significantly on other users unless a lot of users are making requests simultaneously
synrg commented 3 years ago

This is a usability issue for our first public release.

synrg commented 3 years ago

Implemented in the commit series from 1f8fce2f191a2dfa5658f2ec760ed822d3b7b6d4 through 580e916c6ff471261059b4b025c1a9b6ede96472