mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-25 19:37:34 -07:00
fix: run post import async
This commit is contained in:
parent
3a8e6a19b2
commit
369fd4daea
1 changed files with 39 additions and 37 deletions
|
@ -81,6 +81,7 @@ export async function importPosts(
|
|||
} else if (parsed instanceof Object) {
|
||||
logger.info("Parsing animal style posts");
|
||||
for (const post of parsed.orderedItems) {
|
||||
async () =>{
|
||||
try {
|
||||
linenum++;
|
||||
let reply: Note | null = null;
|
||||
|
@ -88,18 +89,18 @@ export async function importPosts(
|
|||
reply = await resolveNote(post.object.inReplyTo);
|
||||
}
|
||||
if (post.directMessage) {
|
||||
continue;
|
||||
return;
|
||||
}
|
||||
if (job.data.signatureCheck) {
|
||||
if (!post.signature) {
|
||||
continue;
|
||||
return;
|
||||
}
|
||||
}
|
||||
let text;
|
||||
try {
|
||||
text = htmlToMfm(post.object.content, post.object.tag);
|
||||
} catch (e) {
|
||||
continue;
|
||||
return;
|
||||
}
|
||||
logger.info(`Posting[${linenum}] ...`);
|
||||
|
||||
|
@ -124,6 +125,7 @@ export async function importPosts(
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// handle error
|
||||
logger.warn(`Error reading: ${e}`);
|
||||
|
|
Loading…
Reference in a new issue