2 Commits

Author SHA1 Message Date
zenfun
4b22b759e7 test(service): add tests for IP ban update edge cases
Add integration tests for `IPBanService.Update` to verify:
- Reactivating an expired ban correctly detects overlaps with existing active bans.
- Explicitly clearing the `expires_at` field (setting to null) works as expected.
2026-01-04 01:45:31 +08:00
zenfun
830c6fa6e7 feat(cron): implement IP ban maintenance tasks
Add IPBanManager to handle periodic background jobs including:
- Expiring outdated bans
- Syncing hit counts from Redis to DB
- Performing full Redis state synchronization

Additionally, update the service expiration logic to use system time
and add unit tests for CIDR normalization and overlap checking.
2026-01-04 01:28:43 +08:00