ruby - rTurk fails getting results from Amazon Mechanical Turk -
i experiencing unusual problem. able submit nail amazon mechanical turk correctly. have cron keeps checking if there job ready reviewed. however, when job completed not receiving nail disposed (what done within function review it). unusual thing problem not happening always, quite often.
this code of function review hits:
def self.review_hits hits = rturk::hit.all_reviewable p "hits" p hits puts "reviewable hits: " + hits.count.to_s hits_results = {} unless hits.empty? hits.each |hit| puts "in each hit" p nail results = [] hit.expire! # results each nail assignment hit.assignments.each |assignment| # check if assignmment has been submitted. can case maximum waiting time # job finish expired , there remain assignments not submitted if assignment.status == 'submitted' p "status 1" p assignment.status temp = {} temp[:worker_id] = assignment.worker_id temp[:answer] = assignment.answers p "status 2" p assignment.status assignment.approve! results << temp end end begin hit.dispose! rescue end hits_results[hit.id] = {} hits_results[hit.id][:results] = results end # allow rails know there new results amazonturkhit.store_results(hits_results) end
end
so puts "reviewable hits:" 0 nail disposed. know why?
after time becoming crazy realised problem silly... had 2 instances of scheme running, 1 in production , 1 in staging both same aws business relationship nail caught other system... :)
ruby amazon-web-services amazon mechanicalturk
No comments:
Post a Comment