Class: ArticleLinkCheckerWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Job, Workers::StatusBroadcastable
Defined in:
app/workers/article_link_checker_worker.rb

Overview

Processes link checks for articles. Supports three 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.

Incremental nightly mode (called with incremental: true):
Finds articles modified since their last audit and runs
the auditor on each. Designed to run alongside the nightly crawler.

Instance Attribute Summary

Attributes included from Workers::StatusBroadcastable

#broadcast_status_updates

Instance Method Summary collapse

Methods included from Workers::StatusBroadcastable::Overrides

#at, #store, #total

Instance Method Details

#perform(options = {}) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
# File 'app/workers/article_link_checker_worker.rb', line 24

def perform(options = {})
  options = options.is_a?(Hash) ? options.symbolize_keys : {}

  if options[:incremental]
    run_incremental_audit(options)
  elsif options[:article_ids]
    run_article_audit(options[:article_ids], options)
  else
    run_legacy_check(options)
  end
end