Skip to content

Commit

Permalink
Enforce non-empty storage_namespace in judge handler
Browse files Browse the repository at this point in the history
  • Loading branch information
magnified103 committed Oct 14, 2024
1 parent 1296bdb commit 7955282
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions judge/bridge/judge_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,10 @@ def submit(self, id, problem, language, source):
data = self.get_related_submission_data(id)
self._working = id
self._no_response_job = threading.Timer(20, self._kill_if_no_response)
if '/' in problem:
storage_namespace, problem = problem.split('/')
else:
storage_namespace = ''
self.send({
request = {
'name': 'submission-request',
'submission-id': id,
'problem-id': problem,
'storage-namespace': storage_namespace,
'language': language,
'source': source if not data.file_only else get_absolute_submission_file_url(source),
'time-limit': data.time,
Expand All @@ -259,7 +254,14 @@ def submit(self, id, problem, language, source):
'file-only': data.file_only,
'file-size-limit': data.file_size_limit,
},
})
}
if '/' in problem:
storage_namespace, problem = problem.split('/')
request.update({
'storage-namespace': storage_namespace,
'problem-id': problem,
})
self.send(request)

def _kill_if_no_response(self):
logger.error('Judge failed to acknowledge submission: %s: %s', self.name, self._working)
Expand Down

0 comments on commit 7955282

Please sign in to comment.