Skip to content

Commit

Permalink
Merge pull request #691 from NoodleOfDeath/dev
Browse files Browse the repository at this point in the history
~topics
  • Loading branch information
NoodleOfDeath authored Oct 11, 2023
2 parents e5b7658 + 0a478f0 commit 09cad91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server/src/worker/TopicWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ export async function doWork() {
where: { originalDate: { [Op.gt]: new Date(Date.now() - ms(DUPLICATE_LOOKBACK_INTERVAL)) } },
});
for (const summary of summaries) {
console.log('checking', summary.id);
console.log('finding siblings for', summary.id);
const siblings: Summary[] = [];
const words = summary.title.replace(/[ \W]+/g, ' ').split(' ').map((w) => w);
const existingSiblings = await summary.getSiblings();
const filteredSummaries = summaries.filter((s) => s.id !== summary.id && !existingSiblings.includes(s.id));
console.log('filters summaries', filteredSummaries.length);
console.log('filtered summaries', filteredSummaries.length);
for (const possibleSibling of filteredSummaries) {
const siblingWords = possibleSibling.title.replace(/[ \W]+/g, ' ').split(' ').map((w) => w);
const score = words.map((a) => {
Expand Down Expand Up @@ -67,7 +67,7 @@ export async function doWork() {
}
}
}
console.log('linking for', summary.id);
console.log('making associations for', summary.id);
for (const sibling of siblings) {
await summary.associateWith(sibling);
}
Expand Down

0 comments on commit 09cad91

Please sign in to comment.