mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
ircd:Ⓜ️:vm::fetch: Add conf items to timeout event and state fetching.
This commit is contained in:
parent
bf2219634a
commit
df9b429344
1 changed files with 24 additions and 2 deletions
|
@ -21,6 +21,8 @@ namespace ircd::m::vm::fetch
|
|||
static void handle(const event &, vm::eval &);
|
||||
|
||||
extern conf::item<size_t> prev_backfill_limit;
|
||||
extern conf::item<seconds> event_timeout;
|
||||
extern conf::item<seconds> state_timeout;
|
||||
extern conf::item<seconds> auth_timeout;
|
||||
extern conf::item<bool> enable;
|
||||
extern hookfn<vm::eval &> hook;
|
||||
|
@ -62,6 +64,20 @@ ircd::m::vm::fetch::auth_timeout
|
|||
{ "default", 15L },
|
||||
};
|
||||
|
||||
decltype(ircd::m::vm::fetch::state_timeout)
|
||||
ircd::m::vm::fetch::state_timeout
|
||||
{
|
||||
{ "name", "ircd.m.vm.fetch.state.timeout" },
|
||||
{ "default", 20L },
|
||||
};
|
||||
|
||||
decltype(ircd::m::vm::fetch::event_timeout)
|
||||
ircd::m::vm::fetch::event_timeout
|
||||
{
|
||||
{ "name", "ircd.m.vm.fetch.event.timeout" },
|
||||
{ "default", 10L },
|
||||
};
|
||||
|
||||
decltype(ircd::m::vm::fetch::prev_backfill_limit)
|
||||
ircd::m::vm::fetch::prev_backfill_limit
|
||||
{
|
||||
|
@ -376,7 +392,10 @@ ircd::m::vm::fetch::state(const event &event,
|
|||
};
|
||||
|
||||
// yields context
|
||||
fetching.wait();
|
||||
const bool done
|
||||
{
|
||||
fetching.wait(seconds(state_timeout), std::nothrow)
|
||||
};
|
||||
|
||||
// evaluate results
|
||||
size_t good(0), fail(0);
|
||||
|
@ -557,7 +576,10 @@ ircd::m::vm::fetch::prev(const event &event,
|
|||
};
|
||||
|
||||
// yields context
|
||||
fetching.wait();
|
||||
const bool done
|
||||
{
|
||||
fetching.wait(seconds(event_timeout), std::nothrow)
|
||||
};
|
||||
|
||||
// evaluate results
|
||||
for(auto &future : futures) try
|
||||
|
|
Loading…
Reference in a new issue