Refactor configs and activitypub parts

This commit is contained in:
Jesse Wierzbinski 2023-10-15 20:04:03 -10:00
parent ca7d325cb1
commit c0ff46559b
17 changed files with 251 additions and 70 deletions

18
benchmarks/fetch.ts Normal file
View file

@ -0,0 +1,18 @@
const timeBefore = performance.now();
const requests: Promise<Response>[] = [];
// Repeat 1000 times
for (let i = 0; i < 1000; i++) {
requests.push(
fetch(`https://mastodon.social`, {
method: "GET",
})
);
}
await Promise.all(requests);
const timeAfter = performance.now();
console.log(`Time taken: ${timeAfter - timeBefore}ms`);

View file

@ -72,7 +72,7 @@ const timeAfter = performance.now();
const activities = await RawActivity.createQueryBuilder("activity")
.where("activity.data->>'actor' = :actor", {
actor: `${config.http.base_url}/@test`,
actor: `${config.http.base_url}/users/test`,
})
.leftJoinAndSelect("activity.objects", "objects")
.getMany();