mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Use logger instead of STDOUT
This commit is contained in:
parent
16a7fcb79b
commit
75d8c4f5c0
1 changed files with 4 additions and 4 deletions
|
@ -21,7 +21,7 @@ def crawl_videos(db)
|
||||||
id = ids[0]
|
id = ids[0]
|
||||||
video = get_video(id, db)
|
video = get_video(id, db)
|
||||||
rescue ex
|
rescue ex
|
||||||
STDOUT << id << " : " << ex.message << "\n"
|
logger.write("#{id} : #{ex.message}\n")
|
||||||
next
|
next
|
||||||
ensure
|
ensure
|
||||||
ids.delete(id)
|
ids.delete(id)
|
||||||
|
@ -73,7 +73,7 @@ def refresh_channels(db, max_threads = 1, full_refresh = false)
|
||||||
|
|
||||||
db.exec("UPDATE channels SET updated = $1, author = $2 WHERE id = $3", Time.now, channel.author, id)
|
db.exec("UPDATE channels SET updated = $1, author = $2 WHERE id = $3", Time.now, channel.author, id)
|
||||||
rescue ex
|
rescue ex
|
||||||
STDOUT << id << " : " << ex.message << "\n"
|
logger.write("#{id} : #{ex.message}\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
active_channel.send(true)
|
active_channel.send(true)
|
||||||
|
@ -94,7 +94,7 @@ def refresh_videos(db)
|
||||||
id = rs.read(String)
|
id = rs.read(String)
|
||||||
video = get_video(id, db)
|
video = get_video(id, db)
|
||||||
rescue ex
|
rescue ex
|
||||||
STDOUT << id << " : " << ex.message << "\n"
|
logger.write("#{id} : #{ex.message}\n")
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -129,7 +129,7 @@ def refresh_feeds(db, max_threads = 1)
|
||||||
begin
|
begin
|
||||||
db.exec("REFRESH MATERIALIZED VIEW #{view_name}")
|
db.exec("REFRESH MATERIALIZED VIEW #{view_name}")
|
||||||
rescue ex
|
rescue ex
|
||||||
STDOUT << "REFRESH " << email << " : " << ex.message << "\n"
|
logger.write("REFRESH #{email} : #{ex.message}\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
active_channel.send(true)
|
active_channel.send(true)
|
||||||
|
|
Loading…
Reference in a new issue