0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-09 13:38:55 +02:00

ircd:Ⓜ️:typing: Report error from timeout worker context; minor cleanup.

This commit is contained in:
Jason Volk 2020-03-16 14:14:14 -07:00
parent 990d2346c4
commit c1672b280f

View file

@ -29,10 +29,10 @@ struct typist
bool operator()(const typist &a, const typist &b) const;
};
ctx::dock
static ctx::dock
timeout_dock;
std::set<typist, typist>
static std::set<typist, typist>
typists;
conf::item<milliseconds>
@ -318,7 +318,9 @@ ircd::m::typing::for_each(const closure &closure)
static void timeout_timeout(const typist &);
static bool timeout_check();
static void timeout_worker();
static context timeout_context
static context
timeout_context
{
"typing",
256_KiB,
@ -336,8 +338,8 @@ timeout_context_terminate
};
void
__attribute__((noreturn))
timeout_worker()
try
{
while(1)
{
@ -350,6 +352,14 @@ timeout_worker()
ctx::sleep(milliseconds(timeout_int));
}
}
catch(const std::exception &e)
{
log::critical
{
typing_log, "Typing timeout worker fatal :%s",
e.what()
};
}
bool
timeout_check()