Skip to content

Commit

Permalink
Fix rows for subscribe job
Browse files Browse the repository at this point in the history
  • Loading branch information
omarroth committed Mar 5, 2019
1 parent e4dc430 commit 99d9c3a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/invidious/jobs.cr
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,13 @@ def subscribe_to_feeds(db, logger, key, config)
spawn do
loop do
db.query_all("SELECT id FROM channels WHERE CURRENT_TIMESTAMP - subscribed > '4 days'") do |rs|
ucid = rs.read(String)
response = subscribe_pubsub(ucid, key, config)
rs.each do
ucid = rs.read(String)
response = subscribe_pubsub(ucid, key, config)

if response.status_code >= 400
logger.write("#{ucid} : #{response.body}\n")
if response.status_code >= 400
logger.write("#{ucid} : #{response.body}\n")
end
end
end

Expand Down

0 comments on commit 99d9c3a

Please sign in to comment.