error will be thrown on expired hit. ignore

This commit is contained in:
Ruben van de Ven 2021-08-10 13:34:21 +02:00
parent 69066588d9
commit 242d936723

View file

@ -98,19 +98,22 @@ class Connection():
logger.debug(f"Save {answer_filename}") logger.debug(f"Save {answer_filename}")
json.dump(assignment, fp, cls=DateTimeEncoder, indent=4) json.dump(assignment, fp, cls=DateTimeEncoder, indent=4)
if not confirm("Accept input of worker (no = reject!!)", True) and confirm("Are you sure you want to reject this user?! (reason in next step)", False): try:
# reject if not confirm("Accept input of worker (no = reject!!)", True) and confirm("Are you sure you want to reject this user?! (reason in next step)", False):
reason = input("Reason for rejection (no newlines)") # reject
response = self.mturk.reject_assignment( reason = input("Reason for rejection (no newlines)")
AssignmentId=assignment['AssignmentId'], response = self.mturk.reject_assignment(
RequesterFeedback=reason AssignmentId=assignment['AssignmentId'],
) RequesterFeedback=reason
else: )
response = self.mturk.approve_assignment( else:
AssignmentId=assignment['AssignmentId'] response = self.mturk.approve_assignment(
# RequesterFeedback=reason AssignmentId=assignment['AssignmentId']
) # RequesterFeedback=reason
)
except Exception as e:
logger.danger("ignoring exception on accepting/rejecting assignment!")
logger.exception(e)
# save with new status after all processing is succesfull # save with new status after all processing is succesfull
with open(hit_file, 'w') as fp: with open(hit_file, 'w') as fp: