Add rescue for video ranking

This commit is contained in:
Omar Roth
2018-03-16 23:57:31 -05:00
parent 2be57276a2
commit 39df8ab200
2 changed files with 6 additions and 2 deletions

View File

@@ -234,7 +234,7 @@ end
def rank_videos(db, n, pool, filter)
top = [] of {Float64, String}
db.query("SELECT id, wilson_score, published FROM videos WHERE views > 5000 ORDER BY published DESC LIMIT 10000") do |rs|
db.query("SELECT id, wilson_score, published FROM videos WHERE views > 5000 ORDER BY published DESC LIMIT 1000") do |rs|
rs.each do
id = rs.read(String)
wilson_score = rs.read(Float64)