forked from solana-labs/governance-ui
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make summary bot, and looping every 30 urgent bot, update to use jeet…
… for realm, etc (#16)
- Loading branch information
1 parent
13fbdc7
commit d928bf1
Showing
4 changed files
with
51 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { withSentry } from '@sentry/nextjs' | ||
import { runNotifier } from '../../scripts/governance-notifier' | ||
|
||
async function handler(req, res) { | ||
if (req?.headers?.authorization !== `Bearer ${process.env.CRON_SECRET}`) { | ||
return res.status(401).send('Unauthorized') | ||
} | ||
try { | ||
await runNotifier(true) | ||
res.status(200).send('Summary notifier executed successfully') | ||
} catch (error) { | ||
console.error(error) | ||
res.status(500).send('Error executing summary notifier') | ||
} | ||
} | ||
|
||
export default withSentry(handler) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
{ | ||
"crons": [ | ||
{ | ||
"path": "/api/gov-notifier-summary", | ||
"schedule": "59 19 * * *" | ||
}, | ||
{ | ||
"path": "/api/gov-notifier", | ||
"schedule": "23 19 * * *" | ||
"schedule": "*/30 * * * *" | ||
} | ||
] | ||
} |