Set updated for deleted channels

This commit is contained in:
Omar Roth 2019-02-27 17:31:17 -06:00
parent 51df0860cc
commit 7ffc3a0652

View file

@ -73,7 +73,7 @@ def refresh_channels(db, logger, max_threads = 1, full_refresh = false)
db.exec("UPDATE channels SET updated = $1, author = $2, deleted = false WHERE id = $3", Time.now, channel.author, id) db.exec("UPDATE channels SET updated = $1, author = $2, deleted = false WHERE id = $3", Time.now, channel.author, id)
rescue ex rescue ex
if ex.message == "Deleted or invalid channel" if ex.message == "Deleted or invalid channel"
db.exec("UPDATE channels SET deleted = true WHERE id = $1", id) db.exec("UPDATE channels SET updated = $1, deleted = true WHERE id = $2", Time.now, id)
end end
logger.write("#{id} : #{ex.message}\n") logger.write("#{id} : #{ex.message}\n")
end end