return await
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
ale 2024-11-10 11:51:12 +01:00
parent 136b7e40d6
commit 8a2747408a

View File

@ -33,7 +33,7 @@ module.exports = async (client, apex, app) => {
redirect: 'follow' redirect: 'follow'
}) })
setImmediate(() => clearTimeout(timeout)) setImmediate(() => clearTimeout(timeout))
return response.json() return await response.json()
} catch (e) { } catch (e) {
return setImmediate(() => { return setImmediate(() => {
clearTimeout(timeout) clearTimeout(timeout)
@ -79,7 +79,7 @@ module.exports = async (client, apex, app) => {
} }
}) })
app.locals.created++ 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 { } else {
const elasticinstance = instancelocated[0]._source.blocks || [] const elasticinstance = instancelocated[0]._source.blocks || []
if (Array.isArray(elasticinstance)) { 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) { 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)) 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) { 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 + '.') console.log('Done: ' + server + ' - ' + i + ' parts with exit ' + exit + '.')
} }
})) }))
return scanReturn() return await scanReturn()
} else { } else {
return scanReturn() return await scanReturn()
} }
} catch (e) { } catch (e) {
// console.error(e) // console.error(e)
return scanReturn() return await scanReturn()
} }
} else { } else {
return scanReturn() return scanReturn()