Skip to content

Commit

Permalink
fix(api): connect openai job with correct resource (#1874)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascariandrea authored Dec 14, 2024
1 parent 8a8ea31 commit bfecea8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ import {
} from "../../../../test/arbitraries/TGMessage.arb.js";
import { saveUser, type UserTest } from "../../../../test/user.utils.js";
import { createFromTGMessage } from "../createFromTGMessage.flow.js";
import { EventSuggestionEntity } from "#entities/EventSuggestion.entity.js";
import { LinkEntity } from "#entities/Link.entity.js";
import { MediaEntity } from "#entities/Media.entity.js";
import { UserEntity } from "#entities/User.entity.js";

const tempDir = path.resolve(__dirname, `../../../../temp/tg/media`);

Expand Down
2 changes: 1 addition & 1 deletion services/api/src/flows/tg/parseDocument.flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const parseDocument =
}),
TE.chainFirst((m) =>
ctx.queue.queue(OpenAIEmbeddingQueueType.value).addJob({
id: uuid(),
id: m.id,
resource: MEDIA.value,
type: OpenAIEmbeddingQueueType.value,
status: PendingStatus.value,
Expand Down
3 changes: 1 addition & 2 deletions services/api/src/flows/tg/parseURL.flow.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { pipe } from "@liexp/core/lib/fp/index.js";
import { isExcludedURL } from "@liexp/shared/lib/helpers/link.helper.js";
import { URL } from "@liexp/shared/lib/io/http/Common/URL.js";
import { uuid } from "@liexp/shared/lib/io/http/Common/UUID.js";
import { LINKS } from "@liexp/shared/lib/io/http/Link.js";
import {
OpenAIEmbeddingQueueType,
Expand Down Expand Up @@ -62,7 +61,7 @@ export const parseURLs =
),
TE.chainFirst((l) =>
ctx.queue.queue(OpenAIEmbeddingQueueType.value).addJob({
id: uuid(),
id: l.id,
status: PendingStatus.value,
type: OpenAIEmbeddingQueueType.value,
resource: LINKS.value,
Expand Down

0 comments on commit bfecea8

Please sign in to comment.