forked from FoundKeyGang/FoundKey
activitypub: allow to group elements for delivery
This commit is contained in:
parent
78c93c5539
commit
1bce487965
1 changed files with 7 additions and 2 deletions
|
@ -19,8 +19,13 @@ export default async (job: Bull.Job<DeliverJobData>) => {
|
||||||
if (await shouldSkipInstance(puny)) return 'skip';
|
if (await shouldSkipInstance(puny)) return 'skip';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (Array.isArray(job.data.content)) {
|
||||||
await request(job.data.user, job.data.to, job.data.content);
|
await Promise.all(
|
||||||
|
job.data.content.map(x => request(job.data.user, job.data.to, x))
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
await request(job.data.user, job.data.to, job.data.content);
|
||||||
|
}
|
||||||
|
|
||||||
// Update stats
|
// Update stats
|
||||||
registerOrFetchInstanceDoc(host).then(i => {
|
registerOrFetchInstanceDoc(host).then(i => {
|
||||||
|
|
Loading…
Reference in a new issue