diff --git a/CHANGES.md b/CHANGES.md index 3e1ad60..cb8b063 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,13 +4,10 @@ Notable changes will be documented here ## 0.9.28 -- sample UI: - - showing the `/stats` results - -## 0.9.27 - - link-checker-service - a simple `/stats` endpoint +- sample UI: + - showing the `/stats` results ## 0.9.26 diff --git a/infrastructure/url_checker.go b/infrastructure/url_checker.go index 8abb963..8340edb 100644 --- a/infrastructure/url_checker.go +++ b/infrastructure/url_checker.go @@ -335,9 +335,10 @@ func onCheckResult(res *URLCheckResult) { case Broken: s.OnLinkBroken() case Dropped: - s.OnLinkDropped() + // handled in the drop handler case Skipped: - s.OnLinkSkipped() + // handled in an upper layer + break } } @@ -430,6 +431,7 @@ func normalizeAddressOf(input string) string { func (c *URLCheckerClient) checkURL(ctx context.Context, urlToCheck string, client *resty.Client) (*URLCheckResult, bool) { select { case <-ctx.Done(): + GlobalStats().OnLinkDropped() return &URLCheckResult{ Status: Dropped, Code: CustomHTTPErrorCode, diff --git a/server/server.go b/server/server.go index 10ea495..b92ed53 100644 --- a/server/server.go +++ b/server/server.go @@ -350,6 +350,7 @@ func translateCheckerTrace(trace []infrastructure.URLCheckerPluginTrace) []URLCh } func urlBlacklisted(url URLRequest) URLStatusResponse { + infrastructure.GlobalStats().OnLinkSkipped() return URLStatusResponse{ URLRequest: url, HTTPStatus: infrastructure.CustomHTTPErrorCode,