Config/Misc

* hardcode sql limits within their respective components instead of
   having them configurable
 * creating a new DBTypeList defaults it to being unlimited
   * SQL_LIMIT_NONE (0) > removed as it only existed for consistency
   * SQL_LIMIT_DEFAULT (300) > frontend / Listview::DEFAULT_SIZE
   * SQL_LIMIT_SEARCH (500) > Search::DEFAULT_MAX_RESULTS
   * SQL_LIMIT_QUICKSEARCH (10) > Search::SUGGESTIONS_MAX_RESULTS
This commit is contained in:
Sarjuuk 2025-12-30 02:55:43 +01:00
parent b9d888ab3a
commit c44bf4f575
69 changed files with 183 additions and 219 deletions

View file

@ -190,11 +190,12 @@ class RemoteGuildList extends GuildList
$distrib[$curTpl['realm']]++;
}
// equalize subject distribution across realms
$limit = 0;
foreach ($conditions as $c)
if (is_int($c))
$limit = $c;
if (is_numeric($c))
$limit = max(0, (int)$c);
$limit ??= Cfg::get('SQL_LIMIT_DEFAULT');
if (!$limit) // int:0 means unlimited, so skip early
return;