Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-14 06:13:09 +00:00

AI inspired fixes

This commit is contained in:
bol-van
2026-01-16 16:17:34 +03:00
parent 65f6923383
commit 681c53c3b4
7 changed files with 16 additions and 16 deletions

View File

@@ -112,15 +112,14 @@ void HostFailPoolPurge(hostfail_pool **pp)
HostFailPoolDel(pp, elem);
}
}
static time_t host_fail_purge_prev=0;
void HostFailPoolPurgeRateLimited(hostfail_pool **pp)
void HostFailPoolPurgeRateLimited(hostfail_pool **pp, time_t *purge_prev)
{
time_t now = time(NULL);
// do not purge too often to save resources
if (host_fail_purge_prev != now)
if (*purge_prev != now)
{
HostFailPoolPurge(pp);
host_fail_purge_prev = now;
*purge_prev = now;
}
}
void HostFailPoolDump(hostfail_pool *p)