• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rm-hull / dot-block / 19199454108
43%

Build:
DEFAULT BRANCH: main
Ran 08 Nov 2025 10:25PM UTC
Jobs 1
Files 13
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

08 Nov 2025 10:25PM UTC coverage: 52.489% (-0.6%) from 53.086%
19199454108

push

github

web-flow
feat: Implement scheduled blocklist reloading (#17)

* feat: Implement scheduled blocklist reloading

This introduces automatic periodic reloading of the blocklist via a
configurable cron schedule.

- Adds the `robfig/cron/v3` dependency.
- Introduces the `--cron-schedule` flag (default: `@every 19h`).
- Refactors `BlockList` initialization to support dynamic
loading/reloading.
- Updates metrics (`blocklist_age`, `blocklist_reloads`) to track reload
  status and frequency.

* fix: Protect BlockList access with RWMutex

The `BlockList` was not thread-safe, leading to potential data
races when the bloom filter was accessed during a reload.

This introduces an `RWMutex` to ensure safe concurrent access:
*   Use write lock during replacement in `Load`.
*   Use read lock during checks in `IsBlocked`.

* fix: Improve cron job error handling and recovery

Enhance robustness by ensuring scheduled tasks fail gracefully
and application startup errors are handled correctly.

*   Added `cron.Recover` middleware to prevent the application
    from crashing if a scheduled job panics.
*   Changed blocklist download failures during cron runs from
    panicking to logging an error.
*   Handle errors returned when attempting to add the cron job
    during application initialization.

* fix: Set initial blocklist update time

* style: Fix typo in cron-schedule help text

The help message for the `--cron-schedule` flag was malformed,
including an extra closing backtick and parenthesis.

44 of 76 new or added lines in 6 files covered. (57.89%)

369 of 703 relevant lines covered (52.49%)

0.56 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
0.0
0.0% main.go
2
86.67
5.71% internal/metrics/blocklist_metrics.go
8
0.0
internal/slog_adapter.go
9
0.0
0.0% internal/app.go
12
0.0
internal/blocklist/cronjob.go
Jobs
ID Job ID Ran Files Coverage
1 19199454108.1 08 Nov 2025 10:25PM UTC 13
52.49
GitHub Action Run
Source Files on build 19199454108
  • Tree
  • List 13
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 596355cf on github
  • Prev Build on main (#19196965040)
  • Next Build on main (#19199673727)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc