dirwatch: one loop that watches a directory, for rules and lookup (closes #429)
check / check (push) Waiting to run

rules and lookup each had the same loop: watch the directory, start a
timer at once, restart it at each change that counts, read again when it
fires. It now lives once in internal/dirwatch, with its quiet time and
its tests. Each package keeps its own log messages, its readAgain, and
its test for which changes count. internal/state keeps its own copy.

Model: opus-5-5
This commit was merged in pull request #458.
This commit is contained in:
clawbot committed 2026-11-19 22:13:55 +01:00
1 parent b2b1716907
commit 06faf0877c
8 files changed
+334 -403

No files matched your search

+3
View File
@@ -94,6 +94,9 @@ never as a time.
imports no other package of this repository: `waf` gives it what it needs
to count and report failures.
- `internal/lookup`: looks clients up in the lookup database.
- `internal/dirwatch`: watches a directory, and calls a function once it has
gone a short time without a change. `internal/rules` and `internal/lookup`
read their files again this way.
- `internal/reputation`: fetches the lists, asks the DNS blocklists and
AbuseIPDB in the background, and keeps their answers. It also fetches
AbuseIPDB's blacklist, which `internal/waf` bans.