From 8a2747408a0deed15e321fa2a02f0cc4c1ff03f6 Mon Sep 17 00:00:00 2001 From: ale Date: Sun, 10 Nov 2024 11:51:12 +0100 Subject: [PATCH] return await --- lib/fediblock.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/fediblock.js b/lib/fediblock.js index 53ac863..0dcd7e9 100644 --- a/lib/fediblock.js +++ b/lib/fediblock.js @@ -33,7 +33,7 @@ module.exports = async (client, apex, app) => { redirect: 'follow' }) setImmediate(() => clearTimeout(timeout)) - return response.json() + return await response.json() } catch (e) { return setImmediate(() => { clearTimeout(timeout) @@ -79,7 +79,7 @@ module.exports = async (client, apex, app) => { } }) app.locals.created++ - return util.sendFederatedMessage(constant.nick, 'New Fediblock Instance', `Fediblock Instance ${instance} with ${json.length} blocks - https://${constant.apexdomain}#${instance}`, getAccount(api)) + return await util.sendFederatedMessage(constant.nick, 'New Fediblock Instance', `Fediblock Instance ${instance} with ${json.length} blocks - https://${constant.apexdomain}#${instance}`, getAccount(api)) } else { const elasticinstance = instancelocated[0]._source.blocks || [] if (Array.isArray(elasticinstance)) { @@ -104,7 +104,7 @@ module.exports = async (client, apex, app) => { if (instancelocated[0]._source.api && instancelocated[0]._source.api.uri && instancelocated[0]._source.api.contact_account && instancelocated[0]._source.api.contact_account.acct) { const difference = blocks.filter(block => block.domain && block.domain.trim().length > 0 && !elasticinstance.some(instance => block.domain === instance.domain)) if (difference.length > 0 && difference.length < 50) { - return util.sendFederatedMessage(constant.nick, 'Detected #Fediblock by Fediblock Instance', `You blocked new instances: ${difference.map(d => d.domain).join(', ')} - https://${constant.apexdomain}#${instance}`, getAccount(instancelocated[0]._source.api)) + return await util.sendFederatedMessage(constant.nick, 'Detected #Fediblock by Fediblock Instance', `You blocked new instances: ${difference.map(d => d.domain).join(', ')} - https://${constant.apexdomain}#${instance}`, getAccount(instancelocated[0]._source.api)) } } } @@ -223,13 +223,13 @@ module.exports = async (client, apex, app) => { console.log('Done: ' + server + ' - ' + i + ' parts with exit ' + exit + '.') } })) - return scanReturn() + return await scanReturn() } else { - return scanReturn() + return await scanReturn() } } catch (e) { // console.error(e) - return scanReturn() + return await scanReturn() } } else { return scanReturn()