mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 08:53:48 +01:00
update post import
This commit is contained in:
parent
97d0cfcc8c
commit
6f4465aa32
@ -19,6 +19,8 @@ export function initialize<T>(name: string, limitPerSec = -1) {
|
||||
}
|
||||
: undefined,
|
||||
settings: {
|
||||
stalledInterval: 60,
|
||||
maxStalledCount: 2,
|
||||
backoffStrategies: {
|
||||
apBackoff,
|
||||
},
|
||||
|
@ -20,9 +20,11 @@ export async function importMastoPost(
|
||||
}
|
||||
const post = job.data.post;
|
||||
let reply: Note | null = null;
|
||||
job.progress(20);
|
||||
if (post.object.inReplyTo != null) {
|
||||
reply = await resolveNote(post.object.inReplyTo);
|
||||
}
|
||||
job.progress(40);
|
||||
if (post.directMessage) {
|
||||
done();
|
||||
return;
|
||||
@ -33,13 +35,14 @@ export async function importMastoPost(
|
||||
return;
|
||||
}
|
||||
}
|
||||
job.progress(60);
|
||||
let text;
|
||||
try {
|
||||
text = htmlToMfm(post.object.content, post.object.tag);
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
job.progress(80);
|
||||
const note = await create(user, {
|
||||
createdAt: new Date(post.object.published),
|
||||
files: undefined,
|
||||
@ -56,6 +59,8 @@ export async function importMastoPost(
|
||||
apHashtags: undefined,
|
||||
apEmojis: undefined,
|
||||
});
|
||||
logger.succ("Imported");
|
||||
job.progress(100);
|
||||
done();
|
||||
|
||||
logger.succ("Imported");
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ export const inboxQueue = initializeQueue<InboxJobData>(
|
||||
"inbox",
|
||||
config.inboxJobPerSec || 16,
|
||||
);
|
||||
export const dbQueue = initializeQueue<DbJobData>("db");
|
||||
export const dbQueue = initializeQueue<DbJobData>("db", 256);
|
||||
export const objectStorageQueue =
|
||||
initializeQueue<ObjectStorageJobData>("objectStorage");
|
||||
export const webhookDeliverQueue = initializeQueue<WebhookDeliverJobData>(
|
||||
|
Loading…
Reference in New Issue
Block a user