tpws: move systemd notify deeper

This commit is contained in:
bol-van
2025-03-12 14:45:52 +03:00
parent cafbb17e70
commit 6493d55977
2 changed files with 15 additions and 14 deletions

View File

@@ -16,6 +16,10 @@
#include <fcntl.h>
#include <netdb.h>
#ifdef USE_SYSTEMD
#include <systemd/sd-daemon.h>
#endif
#include "tpws.h"
#include "tpws_conn.h"
#include "redirect.h"
@@ -25,6 +29,15 @@
#include "hostlist.h"
#include "linux_compat.h"
static void notify_ready(void)
{
#ifdef USE_SYSTEMD
int r = sd_notify(0, "READY=1");
if (r < 0)
DLOG_ERR("sd_notify: %s\n", strerror(-r));
#endif
}
// keep separate legs counter. counting every time thousands of legs can consume cpu
static int legs_local, legs_remote;
/*
@@ -1542,6 +1555,8 @@ int event_loop(const int *listen_fd, size_t listen_fd_ct)
VPRINT("initialized multi threaded resolver with %d threads\n",resolver_thread_count());
}
notify_ready();
for(;;)
{
ReloadCheck();