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