mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
Refactor configs and activitypub parts
This commit is contained in:
parent
ca7d325cb1
commit
c0ff46559b
17 changed files with 251 additions and 70 deletions
18
benchmarks/fetch.ts
Normal file
18
benchmarks/fetch.ts
Normal 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`);
|
||||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue