mirror of
https://github.com/sakaljurgis/nntp-worker.git
synced 2026-07-08 21:27:41 +00:00
initial
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { Repository } from './repository';
|
||||
|
||||
export async function updateLastReplyDate(repository: Repository) {
|
||||
let mismatched = await repository.getLastReplyMismatchedArticles(100);
|
||||
console.log(`Updating last reply date for ${mismatched.totalItems} articles. Total pages: ${mismatched.totalPages}`);
|
||||
while (mismatched.items.length > 0) {
|
||||
for (const item of mismatched.items) {
|
||||
await repository.updateArticle(item.id, {
|
||||
lastReplyDate: item.calculatedLastReplyDate,
|
||||
numReplies: item.calculatedNumReplies,
|
||||
});
|
||||
}
|
||||
|
||||
mismatched = await repository.getLastReplyMismatchedArticles(100);
|
||||
console.log(`Updating last reply date for ${mismatched.totalItems} articles. Total pages: ${mismatched.totalPages}`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user