Skip to content

Commit

Permalink
Merge pull request #2 from tomasanchez/hot-fix
Browse files Browse the repository at this point in the history
hotfix: api
  • Loading branch information
tomasanchez committed Nov 5, 2023
2 parents d7caa60 + d86d703 commit c05f2ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/heimdallr/entrypoint/v1/assignments.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ async def get_assignment_by_id(
Returns an assignment by ID.
"""

model: Assignment | None = await repository.find_by(id=assignment_id) # type: ignore[func-returns-value]
model: Assignment | None = await repository.find_by(_id=str(assignment_id)) # type: ignore[func-returns-value]

if not model:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail=f"Assignment with id {assignment_id} not found.",
)

event = AssignmentVerified(**model.dict())
event = AssignmentVerified(**model.model_dump())

return ResponseModel(data=event)
2 changes: 1 addition & 1 deletion src/heimdallr/service_layer/assignment_verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async def verify(self, command: VerifyAssignment) -> AssignmentVerified:
comparisons: list[AssignmentCompared] = []

# using concurrent.futures to parallelize the comparisons
with concurrent.futures.ProcessPoolExecutor() as executor:
with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [executor.submit(self.compare_assignments, assignment, entry) for assignment in assignments]

for future in concurrent.futures.as_completed(futures):
Expand Down

0 comments on commit c05f2ff

Please sign in to comment.