mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
ircd:Ⓜ️:typing: Add conf item for timeout worker interval.
This commit is contained in:
parent
d7748fb1b3
commit
1765ba8921
1 changed files with 9 additions and 3 deletions
|
@ -49,6 +49,13 @@ timeout_min
|
|||
{ "default", 15 * 1000L },
|
||||
};
|
||||
|
||||
conf::item<milliseconds>
|
||||
timeout_int
|
||||
{
|
||||
{ "name", "ircd.typing.timeout.int" },
|
||||
{ "default", 5 * 1000L },
|
||||
};
|
||||
|
||||
static system_point calc_timesout(milliseconds relative);
|
||||
static bool update_state(const m::edu::m_typing &);
|
||||
|
||||
|
@ -325,15 +332,14 @@ void
|
|||
__attribute__((noreturn))
|
||||
timeout_worker()
|
||||
{
|
||||
while(1)
|
||||
for(;; ctx::sleep(milliseconds(timeout_int)))
|
||||
{
|
||||
timeout_dock.wait([]
|
||||
{
|
||||
return !typists.empty();
|
||||
});
|
||||
|
||||
if(!timeout_check())
|
||||
ctx::sleep(seconds(5));
|
||||
timeout_check();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue