fix: change setImmediate to a 5s timeout to give plugins (or anything waiting for the return value of the API call) a chance to finish execution

This commit is contained in:
Julian Lam
2024-06-19 18:08:58 -04:00
parent 4b86b37889
commit 7fada44bf2

View File

@@ -82,9 +82,9 @@ topicsAPI.create = async function (caller, data) {
socketHelpers.notifyNew(caller.uid, 'newTopic', { posts: [result.postData], topic: result.topicData }); socketHelpers.notifyNew(caller.uid, 'newTopic', { posts: [result.postData], topic: result.topicData });
if (!isScheduling) { if (!isScheduling) {
setImmediate(() => { setTimeout(() => {
activitypubApi.create.note(caller, { pid: result.postData.pid }); activitypubApi.create.note(caller, { pid: result.postData.pid });
}); }, 5000);
} }
return result.topicData; return result.topicData;