mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-30 02:32:56 +05:30
Use logger instead of STDOUT
This commit is contained in:
parent
16a7fcb79b
commit
75d8c4f5c0
@ -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 New Issue
Block a user