Skip to content

Commit

Permalink
Fix unnecessary id storage for feeds with custom comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
synzen committed Dec 9, 2024
1 parent e559337 commit 332dfb9
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions services/user-feeds/src/articles/articles.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,15 +565,17 @@ export class ArticlesService {
) {
const fieldsToSave: PartitionedFeedArticleFieldInsert[] = [];

for (let i = 0; i < articles.length; ++i) {
const article = articles[i];

fieldsToSave.push({
feedId: feedId,
fieldName: "id",
fieldHashedValue: article.flattened.idHash,
createdAt: new Date(),
});
if (!options?.skipIdStorage) {
for (let i = 0; i < articles.length; ++i) {
const article = articles[i];

fieldsToSave.push({
feedId: feedId,
fieldName: "id",
fieldHashedValue: article.flattened.idHash,
createdAt: new Date(),
});
}
}

try {
Expand Down

0 comments on commit 332dfb9

Please sign in to comment.