2014-10-20 4 views
0

매우 이상한 문제가 있습니다. HIT를 Amazon Mechanical Turk에 올바르게 제출할 수 있습니다. 검토 할 준비가 된 작업이 있는지 계속 확인하는 cron이 있습니다. 그러나 작업이 완료되면받을 수 없지만 HIT는 처리됩니다 (기능을 검토하기 위해 수행되는 작업). 이상한 것은이 문제가 항상 일어나지는 않지만 꽤 자주 발생한다는 것입니다.rTurk가 Amazon Mechanical Turk에서 결과를 얻지 못합니다.

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 do |hit| 
    puts "IN EACH HIT" 
    p hit 
    results = [] 
    hit.expire! 

    # Get results for each HIT assignment 
    hit.assignments.each do |assignment| 
     # Check if the assignmment has been submitted. It can be the case where the maximum waiting time 
     # for the job to finish expired and there remain assignments that are 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 

    # Let Rails know that there are new results 
    AmazonTurkHit.store_results(hits_results) 
end 

그래서 박았 "검토 가능한 HITS :"

는 안타를 검토 할 수있는 기능의 코드 0하지만 HIT가 배치되어있다. 아무도 이유를 아나요?

답변

0

언젠가이 문제에 대해 미쳐 버린 후에 나는 그 문제가 매우 어리 석다는 것을 깨달았습니다 ... 프로덕션에서 하나는 준비 중이지만 둘은 같은 AWS 계정으로 실행되는 두 개의 시스템 인스턴스가있었습니다. 다른 시스템에 잡히다 ... :)