Class: ArticleLinkCheckerWorker
- Inherits:
-
Object
- Object
- ArticleLinkCheckerWorker
- Includes:
- RouteUrlHelpers, Sidekiq::Job, Workers::StatusBroadcastable
- Defined in:
- app/workers/article_link_checker_worker.rb
Overview
Processes link checks for articles. Supports two modes:
Legacy mode (default when called with link hrefs or no args):
Processes pending LinkCheck records for external links.
Audit mode (called with article_ids: [...]):
Runs the unified ArticleLinkAuditor on specific articles,
persisting results and updating the editorial link graph.
Supports job status tracking with redirect_to for the CRM UI.
Constant Summary
Constants included from RouteUrlHelpers
Instance Attribute Summary
Attributes included from Workers::StatusBroadcastable
Instance Method Summary collapse
Methods included from Workers::StatusBroadcastable::Overrides
Instance Method Details
#perform(options = {}) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/workers/article_link_checker_worker.rb', line 25 def perform( = {}) # Guard, not normalization: LinkCheck#replace_links enqueues an ARRAY of new # links (app/models/link_check.rb), so `options` is not always a Hash. Key # spelling itself is handled by Sidekiq::NormalizeArgsMiddleware::Server. = {} unless .is_a?(Hash) if [:article_ids] run_article_audit([:article_ids], ) else run_legacy_check() end end |