Skip to content

Commit

Permalink
chore: try/catch cliff notifications job
Browse files Browse the repository at this point in the history
  • Loading branch information
1emu committed Aug 28, 2024
1 parent 72e479b commit 664b9ce
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/entities/Proposal/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,12 @@ async function updateProposalsAndBudgets(proposalsWithOutcome: ProposalWithOutco
}

export async function notifyCliffEndingSoon() {
const vestings = await VestingService.getVestingsWithRecentlyEndedCliffs()
const vestingAddresses = vestings.map((vesting) => vesting.address)
const proposalContributors = await ProposalService.findContributorsForProposalsByVestings(vestingAddresses)
await NotificationService.cliffEnded(proposalContributors)
try {
const vestings = await VestingService.getVestingsWithRecentlyEndedCliffs()
const vestingAddresses = vestings.map((vesting) => vesting.address)
const proposalContributors = await ProposalService.findContributorsForProposalsByVestings(vestingAddresses)
await NotificationService.cliffEnded(proposalContributors)
} catch (error) {
ErrorService.report('Error notifying cliff ending soon', { error, category: ErrorCategory.Job })
}
}

0 comments on commit 664b9ce

Please sign in to comment.