0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-01-14 00:34:18 +01:00

ircd:Ⓜ️:acquire: Pass an attempt cap from opts to m::fetch.

This commit is contained in:
Jason Volk 2020-11-20 19:49:06 -08:00
parent e1d52b28ce
commit 5872604280
2 changed files with 5 additions and 1 deletions

View file

@ -105,6 +105,10 @@ struct ircd::m::acquire::opts
/// Limit the number of requests in flight at any given time.
size_t fetch_width {128};
/// Fetch attempt cap passed to m::fetch, because the default there is
/// unlimited and that's usually a waste of time in practice.
size_t attempt_max {16};
/// Default vm::opts to be used during eval; some options are
/// unconditionally overriden to perform some evals. Use caution, setting
/// options may cause results not expected from this interface.

View file

@ -415,7 +415,7 @@ try
fopts.event_id = event_id;
fopts.backfill_limit = limit;
fopts.hint = hint;
fopts.attempt_limit = hint_only;
fopts.attempt_limit = hint_only? 1: opts.attempt_max;
fetching.emplace_back(result
{
vmopts, fetch::start(fopts), event_id