Skip to content

Node.js based forum software built for the modern web

fix(activitypub/jobs): only run drainLoop on primary process

Julian Lam5c5dc763f826
diff --git a/src/activitypub/jobs.js b/src/activitypub/jobs.js
index 70af53c003..3145c4f705 100644
--- a/src/activitypub/jobs.js
+++ b/src/activitypub/jobs.js
@@ -72,7 +72,9 @@ Jobs.start = async () => {
// Start draining the send retry queue so tasks left over from a previous
// run are retried without waiting for the next outgoing send
- if (meta.config.activitypubEnabled) {
+ // Only the primary process runs the drain loop to avoid duplicate sends
+ // across parallel NodeBB instances.
+ if (meta.config.activitypubEnabled && nconf.get('isPrimary')) {
activitypub.SendPool.drainLoop();
}
};