Skip to content

Commit

Permalink
Fix crawl result logs (#134)
Browse files Browse the repository at this point in the history
Fix the crawl result log to correctly display `success` when no purge
crawl was required.

- Update crawl stage status when skipping purge crawls
- Log correct outcome message in final log
  • Loading branch information
navarone-feekery authored Sep 5, 2024
1 parent 068ad59 commit 66784f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/crawler/api/crawl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def record_overall_outcome(results)
end

outcome = combined_outcome(results)
message = "#{results[:primary][:message]} | #{results[:purge][:outcome]}"
message = "#{results[:primary][:message]} | #{results[:purge][:message]}"
record_outcome(outcome:, message:)
end

Expand Down
2 changes: 2 additions & 0 deletions lib/crawler/coordinator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ def run_purge_crawl!

if purge_urls.empty?
system_logger.info('No documents were found for the purge crawl. Skipping purge crawl.')
set_outcome(:success, "Skipped #{@crawl_stage} crawl as no outdated documents were found.")
log_crawl_end_event
return
end

Expand Down

0 comments on commit 66784f8

Please sign in to comment.