Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit c46d1b2

Browse files
authored
Merge pull request #901 from transitland/sidekiq-feedvalidator-fixes
Feedvalidator ops improvements
2 parents 75ee48b + 9254b44 commit c46d1b2

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

app/services/feed_fetcher_service.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,16 @@ def self.run_google_feedvalidator(filename)
8585
Tempfile.open(['feedvalidator', '.html']) do |tmpfile|
8686
outfile = tmpfile.path
8787
end
88+
8889
# Run feedvalidator
89-
feedvalidator_output = IO.popen([
90-
FEEDVALIDATOR_PATH,
91-
'-n',
92-
'-o',
93-
outfile,
94-
filename
95-
]).read
90+
feedvalidator_output = nil
91+
IO.popen([FEEDVALIDATOR_PATH, '-n', '-o', outfile, filename], "w+") do |io|
92+
io.write("\n")
93+
io.close_write
94+
feedvalidator_output = io.read
95+
end
96+
# feedvalidator_output
97+
9698
return unless File.exists?(outfile)
9799
# Unlink temporary file
98100
file_feedvalidator = File.open(outfile)

app/workers/feed_fetcher_worker.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class FeedFetcherWorker
22
include Sidekiq::Worker
33

44
sidekiq_options unique: :until_and_while_executing,
5-
unique_job_expiration: 60 * 60 # 1 hour
5+
unique_job_expiration: 22 * 60 * 60 # 22 hours
66

77
def perform(feed_onestop_id)
88
begin

0 commit comments

Comments
 (0)