aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-02-18 14:44:12 +0100
committerChocobozzz <chocobozzz@cpy.re>2021-02-19 09:36:50 +0100
commitfae6e4da8f516a9d6c3bad9bf6f35811ccacbad8 (patch)
tree38df5942cb2fa6e5860c8e0e19471eb6b124e291 /server/lib
parent3f8ae0e4e4da90c964597e4b3e0724da5eaa1668 (diff)
downloadPeerTube-fae6e4da8f516a9d6c3bad9bf6f35811ccacbad8.tar.gz
PeerTube-fae6e4da8f516a9d6c3bad9bf6f35811ccacbad8.tar.zst
PeerTube-fae6e4da8f516a9d6c3bad9bf6f35811ccacbad8.zip
Try to speed up server tests
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/activitypub/inbox-manager.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/lib/activitypub/inbox-manager.ts b/server/lib/activitypub/inbox-manager.ts
index 6d9bf7cf0..18ae49532 100644
--- a/server/lib/activitypub/inbox-manager.ts
+++ b/server/lib/activitypub/inbox-manager.ts
@@ -35,7 +35,7 @@ class InboxManager {
35 }) 35 })
36 36
37 setInterval(() => { 37 setInterval(() => {
38 StatsManager.Instance.updateInboxStats(this.messagesProcessed, this.inboxQueue.length()) 38 StatsManager.Instance.updateInboxStats(this.messagesProcessed, this.getActivityPubMessagesWaiting())
39 }, SCHEDULER_INTERVALS_MS.updateInboxStats) 39 }, SCHEDULER_INTERVALS_MS.updateInboxStats)
40 } 40 }
41 41
@@ -44,6 +44,10 @@ class InboxManager {
44 .catch(err => logger.error('Cannot add options in inbox queue.', { options, err })) 44 .catch(err => logger.error('Cannot add options in inbox queue.', { options, err }))
45 } 45 }
46 46
47 getActivityPubMessagesWaiting () {
48 return this.inboxQueue.length() + this.inboxQueue.running()
49 }
50
47 static get Instance () { 51 static get Instance () {
48 return this.instance || (this.instance = new this()) 52 return this.instance || (this.instance = new this())
49 } 53 }