Skip to content

Commit

Permalink
perf: remove awaits from all internal logging (#656)
Browse files Browse the repository at this point in the history
  • Loading branch information
skinmaker1345 authored Sep 17, 2024
1 parent 39917f7 commit 18b6907
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pages/api/v1/bots/servers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const BotStats = RequestHandler()
version: 1,
})
get.bot.clear(bot)
await webhookClients.internal.statsLog.send({
webhookClients.internal.statsLog.send({
content: `[BOT/STATS] <@${botInfo.id}> (${botInfo.id})\n${makeDiscordCodeblock(
`${botInfo.servers > validated.servers ? '-' : '+'} ${botInfo.servers} -> ${
validated.servers
Expand Down
2 changes: 1 addition & 1 deletion pages/api/v2/bots/[id]/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const Bots = RequestHandler()
}
)
const userinfo = await get.user.load(user)
await webhookClients.internal.reviewLog.send({
webhookClients.internal.reviewLog.send({
embeds: [
new EmbedBuilder()
.setAuthor({
Expand Down
2 changes: 1 addition & 1 deletion pages/api/v2/bots/[id]/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const BotReport = RequestHandler()
})

if (!validated) return
await webhookClients.internal.reportChannel.send({
webhookClients.internal.reportChannel.send({
threadName: `봇-${bot.id}`,
content: `Reported by <@${user}> (${user})\nReported **${bot.name}** <@${bot.id}> (${bot.id})\nCategory ${req.body.category}\nDesc\n\`\`\`${req.body.description}\`\`\``,
allowedMentions: { parse: ['users'] },
Expand Down
2 changes: 1 addition & 1 deletion pages/api/v2/bots/[id]/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const BotStats = RequestHandler()
timestamp: Date.now(),
})
}
await webhookClients.internal.statsLog.send({
webhookClients.internal.statsLog.send({
content: `[BOT/STATS] <@${botInfo.id}> (${botInfo.id})\n${makeDiscordCodeblock(
`${botInfo.servers > validated.servers ? '-' : '+'} ${botInfo.servers} -> ${
validated.servers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const ApproveBotSubmit = RequestHandler().post(async (req: ApiRequest, res) => {
)
.setTimestamp()
if (req.body.reviewer) embed.addFields({ name: '📃 정보', value: `심사자: ${req.body.reviewer}` })
await webhookClients.internal.reviewLog.send({ embeds: [embed] })
webhookClients.internal.reviewLog.send({ embeds: [embed] })
tracer.trace('botSubmits.approve', (span) => {
span.setTag('id', submit.id)
span.setTag('date', submit.date)
Expand Down
4 changes: 2 additions & 2 deletions pages/api/v2/management/bots/submits/[id]/[date]/deny.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const DenyBotSubmit = RequestHandler().post(async (req: ApiRequest, res) => {
: ''
}${req.body.reviewer ? `심사자: ${req.body.reviewer}` : ''}`,
})
await webhookClients.internal.reviewLog.send({ embeds: [embed] })
webhookClients.internal.reviewLog.send({ embeds: [embed] })
const openEmbed = new EmbedBuilder()
.setTitle('거부')
.setColor(Colors.Red)
Expand All @@ -53,7 +53,7 @@ const DenyBotSubmit = RequestHandler().post(async (req: ApiRequest, res) => {
: '없음'
}`,
})
await webhookClients.internal.openReviewLog.send({ embeds: [openEmbed] })
webhookClients.internal.openReviewLog.send({ embeds: [openEmbed] })
tracer.trace('botSubmits.deny', (span) => {
span.setTag('id', submit.id)
span.setTag('date', submit.date)
Expand Down
2 changes: 1 addition & 1 deletion pages/api/v2/servers/[id]/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const ServerReport = RequestHandler()
})

if (!validated) return
await webhookClients.internal.reportChannel.send({
webhookClients.internal.reportChannel.send({
threadName: `서버-${server.id}`,
content: `Reported by <@${user}> (${user})\nReported **${server.name}** (${server.id})\nCategory ${req.body.category}\nDesc\n\`\`\`${req.body.description}\`\`\``,
allowedMentions: { parse: ['users'] },
Expand Down
2 changes: 1 addition & 1 deletion pages/api/v2/users/[id]/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const UserReport = RequestHandler()
})

if (!validated) return
await webhookClients.internal.reportChannel.send({
webhookClients.internal.reportChannel.send({
threadName: `유저-${userInfo.id}`,
content: `Reported by <@${user}> (${user})\nReported **${
userInfo.tag === '0'
Expand Down

0 comments on commit 18b6907

Please sign in to comment.