handle error case for recommendation service
This commit is contained in:
@@ -46,6 +46,9 @@ module RecommenderService
|
|||||||
)
|
)
|
||||||
JSON.parse(resp.body)
|
JSON.parse(resp.body)
|
||||||
end
|
end
|
||||||
|
if ids == "error"
|
||||||
|
return []
|
||||||
|
end
|
||||||
Post.find(ids.reject {|x| x[0] == post_id}.map(&:first))
|
Post.find(ids.reject {|x| x[0] == post_id}.map(&:first))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user