After a long task (14 seconds and maybe more with more than 600 Facebook calls), my application returns an internal 500 internal server error with the following description:
Koala::Facebook::APIError (GraphMethodException: Unsupported get request.)
What I'm doing is something like this:
@FBGraph = Koala::Facebook::API.new
tud = MyUsers.all
tud.each do |user|
graph = @FBGraph.get_object(user.fb_user_id)
picture = @FBGraph.get_picture(user.fb_user_id)
thisTud = MyUsers.find(user.id)
thisTud.name = graph["name"]
thisTud.url = graph["link"]
thisTud.url_pic = picture
if thisTud.save
puts "Saved!"
else
puts "Error"
end
end
I get everything (on the terminal) "Saved!", but after retrieving the data, it automatically performs mysql operations, and it fails. And the data is not stored in the database.
As suggested in this post , I put @FBGraph = Koala::Facebook::API.newin a new thread, but nothing changes.
Note: when I performed the same operations with fewer users, everything worked fine.