0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd:Ⓜ️:typing: Add conf item for timeout worker interval.

This commit is contained in:
Jason Volk 2020-02-21 11:54:48 -08:00
parent d7748fb1b3
commit 1765ba8921

View file

@ -49,6 +49,13 @@ timeout_min
{ "default", 15 * 1000L }, { "default", 15 * 1000L },
}; };
conf::item<milliseconds>
timeout_int
{
{ "name", "ircd.typing.timeout.int" },
{ "default", 5 * 1000L },
};
static system_point calc_timesout(milliseconds relative); static system_point calc_timesout(milliseconds relative);
static bool update_state(const m::edu::m_typing &); static bool update_state(const m::edu::m_typing &);
@ -325,15 +332,14 @@ void
__attribute__((noreturn)) __attribute__((noreturn))
timeout_worker() timeout_worker()
{ {
while(1) for(;; ctx::sleep(milliseconds(timeout_int)))
{ {
timeout_dock.wait([] timeout_dock.wait([]
{ {
return !typists.empty(); return !typists.empty();
}); });
if(!timeout_check()) timeout_check();
ctx::sleep(seconds(5));
} }
} }