Skip to content

Commit

Permalink
Fixed submissions for multiple participant studies
Browse files Browse the repository at this point in the history
  • Loading branch information
meta-paul committed Jul 5, 2023
1 parent 2a0dba3 commit 1e8e276
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mephisto/abstractions/architects/ec2/ec2_architect.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def __setup_ec2_server(self) -> str:
server_dir,
)

# TODO: Remove this kack to address sporadic ConnectionRefusedError
# TODO: Remove this hack to address sporadic ConnectionRefusedError
print("EC2: Waiting to establish connection...")
time.sleep(10)

Expand Down
11 changes: 10 additions & 1 deletion mephisto/abstractions/providers/prolific/prolific_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ def get_status(self) -> str:

requester: 'ProlificRequester' = self.get_requester()
client = self._get_client(requester.requester_name)

# time.sleep(2) # Prolific servers may take time to bring their data up-to-date
study = prolific_utils.get_study(client, prolific_study_id)

if study is None:
Expand All @@ -173,7 +175,14 @@ def get_status(self) -> str:
elif study.status == StudyStatus.UNPUBLISHED:
external_status = AssignmentState.COMPLETED
elif study.status == StudyStatus.ACTIVE:
external_status = AssignmentState.LAUNCHED
if self.worker_id is None:
# Check for NULL worker_id to prevent accidental reversal of unit's progress
if external_status != AssignmentState.LAUNCHED:
logger.debug(
f'Moving Unit {self.id} status from '
f'`{external_status}` to `{AssignmentState.LAUNCHED}`'
)
external_status = AssignmentState.LAUNCHED
elif study.status == StudyStatus.SCHEDULED:
# TODO (#1008): Choose correct mapping
pass
Expand Down

0 comments on commit 1e8e276

Please sign in to comment.