Skip to content

Commit

Permalink
feat(billboard): skip slack alert
Browse files Browse the repository at this point in the history
  • Loading branch information
gitwoz committed Aug 29, 2024
1 parent 65c60a9 commit 4d7f908
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
32 changes: 16 additions & 16 deletions handlers/qf-calculate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
sendQfNotifications, // sendQfNotificationNEmails,
} from '../lib/qf-notify.js'
import { s3GetFile } from '../lib/utils/aws.js'
import { SLACK_MESSAGE_STATE, Slack } from '../lib/utils/slack.js'
// import { SLACK_MESSAGE_STATE, Slack } from '../lib/utils/slack.js'

const ACCESS_TOKEN = `${process.env.ACCESS_TOKEN}`

Expand All @@ -36,7 +36,7 @@ export const handler = async (
console.log(`Context: ${JSON.stringify(context, null, 2)}`)
// const forceRun = !!("forceRun" in ((event?.queryStringParameters as any) || {}));

const slack = new Slack()
// const slack = new Slack()
const { method, path } = ((event?.requestContext as any)?.http as any) || {}
const queryStringParameters = (event?.queryStringParameters as any) || {}
const {
Expand Down Expand Up @@ -163,20 +163,20 @@ export const handler = async (
amountTotal,
6
)} USDT to ${sent?.length ?? 0} authors`
if (Array.isArray(sent) && sent?.length > 0) {
await slack.sendStripeAlert({
data: {
amountTotal,
sent: sent.length,
distrib: sent.map(
({ userName, displayName, amount }: any) =>
`${displayName} @${userName} ${amount} USDT`
),
},
message,
state: SLACK_MESSAGE_STATE.successful,
})
}
// if (Array.isArray(sent) && sent?.length > 0) {
// await slack.sendStripeAlert({
// data: {
// amountTotal,
// sent: sent.length,
// distrib: sent.map(
// ({ userName, displayName, amount }: any) =>
// `${displayName} @${userName} ${amount} USDT`
// ),
// },
// message,
// state: SLACK_MESSAGE_STATE.successful,
// })
// }
return {
statusCode: 200,
body: message,
Expand Down
5 changes: 5 additions & 0 deletions lib/qf-calculate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,11 @@ export async function finalizeQFScore({

const targetRound = rounds.find((r) => r.dirpath === currRoundPath)

if (!targetRound) {
console.error(new Date(), `no round found for ${currRoundPath}`)
return
}

const roundsFileContent =
'[ ' +
rounds
Expand Down

0 comments on commit 4d7f908

Please sign in to comment.