Penny-Dreadful-Tools icon indicating copy to clipboard operation
Penny-Dreadful-Tools copied to clipboard

Should load_people, load_decks, etc. return total or not

Open bakert opened this issue 9 months ago • 2 comments

I refactored them to return {results, total} because that's what the API wants. And because in general it's dangerous to form queries that don't have a limit. The refactoring made it so that we're issuing one query to get results+total instead of two queries. However in practical terms almost all the calls to these funcs don't include a limit and discard the total as irrelevant. So perhaps load_decks and friends should go back to having a single return value, and you call load_decks_with_total or something from the API. Or perhaps every callsite should be examined for potential perf issues. I dropped slow_query to 500ms yesterday and haven't heard anything so perhaps eveyrhting we're doing is just fine. Needs some thought.

bakert avatar May 07 '24 13:05 bakert