Skip to content

Commit

Permalink
removed unnecessary create_hit_type_lock
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Feng committed Jul 21, 2017
1 parent 80cfc53 commit b49bfed
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions parlai/mturk/core/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
ASSIGNMENT_REJECTED = 'Rejected'

polling_interval = 1 # in seconds
create_hit_type_lock = threading.Lock()
local_db_lock = threading.Lock()
debug = False

Expand Down Expand Up @@ -220,15 +219,14 @@ def create_hits(self, opt):
mturk_agent_HIT_url_dict = {}
for mturk_agent_id in self.mturk_agent_ids:
for hit_index in range(1, opt['num_hits']+1):
with create_hit_type_lock:
hit_type_id = create_hit_type(
hit_title=opt['hit_title'],
hit_description=opt['hit_description'] + ' (ID: ' + self.task_group_id + ', Role: ' + mturk_agent_id + ')',
hit_keywords=opt['hit_keywords'],
hit_reward=opt['reward'],
assignment_duration_in_seconds=opt.get('assignment_duration_in_seconds', 30 * 60), # Set to 30 minutes by default
is_sandbox=opt['is_sandbox']
)
hit_type_id = create_hit_type(
hit_title=opt['hit_title'],
hit_description=opt['hit_description'] + ' (ID: ' + self.task_group_id + ', Role: ' + mturk_agent_id + ')',
hit_keywords=opt['hit_keywords'],
hit_reward=opt['reward'],
assignment_duration_in_seconds=opt.get('assignment_duration_in_seconds', 30 * 60), # Set to 30 minutes by default
is_sandbox=opt['is_sandbox']
)
all_agent_ids_string = str(self.all_agent_ids).replace("'", '''"''')
mturk_chat_url = self.html_api_endpoint_url + "?method_name=chat_index&task_group_id="+str(self.task_group_id)+"&all_agent_ids="+all_agent_ids_string+"&cur_agent_id="+str(mturk_agent_id)
mturk_page_url = create_hit_with_hit_type(
Expand Down

0 comments on commit b49bfed

Please sign in to comment.