Skip to content

Commit

Permalink
chore: allow live evals in all doc versions not only live versions (#287
Browse files Browse the repository at this point in the history
)
  • Loading branch information
geclos authored Sep 26, 2024
1 parent ea1bc2c commit d50bdb4
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions packages/core/src/events/handlers/runLiveEvaluationsJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { setupJobs } from '@latitude-data/jobs'

import { DocumentLogCreatedEvent } from '.'
import { findWorkspaceFromDocumentLog } from '../../data-access'
import { NotFoundError, Result } from '../../lib'
import { CommitsRepository, EvaluationsRepository } from '../../repositories'
import { NotFoundError } from '../../lib'
import { EvaluationsRepository } from '../../repositories'

export const runLiveEvaluationsJob = async ({
data: event,
Expand All @@ -15,12 +15,6 @@ export const runLiveEvaluationsJob = async ({
if (!workspace) {
throw new NotFoundError('Workspace not found')
}

const commitId = documentLog.commitId
const commitsScope = new CommitsRepository(workspace.id)
const commit = await commitsScope.find(commitId).then((r) => r.unwrap())
if (!commit.mergedAt) return Result.nil()

const scope = new EvaluationsRepository(workspace.id)
const evaluations = await scope
.findByDocumentUuid(documentLog.documentUuid)
Expand Down

0 comments on commit d50bdb4

Please sign in to comment.