Skip to content

Commit

Permalink
feature: Use new core protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
worldbeater committed Nov 17, 2024
1 parent 7331257 commit 9689438
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion webapp/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self):
def run(self, dir: str):
config = AppConfigManager(lambda: load_config_files(dir)).config
print(f'Seeding db {config.connection_string} using core {config.core_path}...')
groups, tasks = worker.load_tests(config.core_path)
groups, tasks, _ = worker.load_config(config.core_path)
migrate(config.connection_string)
db = AppDatabase(lambda: config.connection_string)
db.groups.delete_all()
Expand Down
9 changes: 4 additions & 5 deletions webapp/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,18 @@ def check_solution(
return (ok, error)


def load_tests(core_path: str):
def load_config(core_path: str):
if core_path not in sys.path:
sys.path.insert(1, core_path)
from check_solution import GROUPS, TASKS
return GROUPS, TASKS
from check_solution import load_config
return load_config()


def analyze_solution(analytics_path: str, task: int, code: str):
if analytics_path not in sys.path:
sys.path.insert(1, analytics_path)
from analyze_solution import analyze_solution
analytics = analyze_solution(task, code)
return analytics
return analyze_solution(task, code)


def process_pending_messages(config: AppConfig, db: AppDatabase):
Expand Down

0 comments on commit 9689438

Please sign in to comment.