Skip to content

Commit

Permalink
BRK-6 Broker communication update after merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZyndramZM committed Sep 18, 2023
1 parent a26b1f2 commit 6e0d260
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
7 changes: 2 additions & 5 deletions broker/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,8 @@ def set_submit_update(self, status: SubmitState):
self._change_state(status)
elif end_statuses == len(self.sets):
ok_statuses = self.sets_statuses[SubmitState.DONE]
if ok_statuses == len(self.sets):
self._change_state(SubmitState.DONE)
else:
self._change_state(SubmitState.ERROR,
f'Some sets ended with an error ({ok_statuses}/{len(self.sets)} OK)')
if ok_statuses != len(self.sets):
raise self.JudgingError(f'Some sets ended with an error ({ok_statuses}/{len(self.sets)} OK)')

def close_set_submit(self, set_name: str, results: SetResult):
with self._gather_results_lock:
Expand Down
4 changes: 2 additions & 2 deletions scratch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from broker.submit import *
from broker.master import *

pkg_path = BASE_DIR / 'tests' / 'test_packages' / 'bid'
submit_path = pkg_path / '1' / 'prog' / 'bid.cpp'
pkg_path = BASE_DIR / 'tests' / 'test_packages' / '1'
submit_path = pkg_path / '1' / 'prog' / 'solution.cpp'

master = BrokerMaster(DB_STRING, SUBMITS_DIR, DELETE_RECORDS)
master.connection.truncate_db()
Expand Down
2 changes: 1 addition & 1 deletion settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
set_base_dir(PACKAGES_DIR)
add_supported_extensions('cpp')

BACA_URL = ''
BACA_URL = 'http://127.0.0.1:8000/broker_api'
# Passwords for protecting communication channels between the broker and BaCa2.
# PASSWORDS HAVE TO DIFFERENT IN ORDER TO BE EFFECTIVE
BACA_PASSWORD = 'tmp-baca-password'
Expand Down

0 comments on commit 6e0d260

Please sign in to comment.