Skip to content

Commit

Permalink
minor: create evaluation result transactionally with the evaluation run
Browse files Browse the repository at this point in the history
  • Loading branch information
geclos committed Sep 13, 2024
1 parent b6436d3 commit 806e3ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/services/evaluations/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const runEvaluation = async (
if (result.error) return result

result.value.response.then((response) => {
publisher.publishLater({
publisher.publish({
type: 'evaluationRun',
data: {
evaluationId: evaluation.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ export const runEvaluationJob = async (job: Job<RunEvaluationJobData>) => {
.find(evaluationId)
.then((r) => r.unwrap())

await runEvaluation({
const { response } = await runEvaluation({
documentLog,
evaluation,
})
}).then((r) => r.unwrap())

await response

await progressTracker.incrementCompleted()
} catch (error) {
Expand Down

0 comments on commit 806e3ed

Please sign in to comment.