File tree Expand file tree Collapse file tree 3 files changed +204
-4
lines changed
Expand file tree Collapse file tree 3 files changed +204
-4
lines changed Original file line number Diff line number Diff line change 1- import type { Config , Context } from '@netlify/functions'
1+ import type { Config , Handler } from '@netlify/functions'
22import { getStore } from '@netlify/blobs'
3+ import { schedule } from '@netlify/functions'
4+ import { wrap } from '@netlify/integrations'
5+
6+ import { withSentry } from '@netlify/sentry'
37import type { Clubs } from '~/types/clubs'
48import updateClubInfo from '~/utils/update-club-info'
59
6- export default async ( context : Context ) => {
10+ async function myHandler ( ) {
711 const store = getStore ( 'enspire' )
812 const clubs : Clubs = await updateClubInfo ( )
913 await store . setJSON ( 'clubs' , clubs )
1014
1115 return new Response ( 'Done' )
1216}
1317
14- export const config : Config = {
15- schedule : '0 */12 * * *' ,
18+ const withIntegrations = wrap ( withSentry )
19+
20+ const config : Config = {
21+ sentry : {
22+ cronMonitoring : {
23+ enable : true ,
24+ monitorId : 'update-club-info' ,
25+ } ,
26+ } ,
1627}
28+
29+ const handlerWithIntegrations = withIntegrations ( myHandler , config ) as Handler
30+
31+ const handler = schedule ( '@hourly' , handlerWithIntegrations )
32+
33+ export { handler }
Original file line number Diff line number Diff line change 2020 "@clerk/clerk-sdk-node" : " ^5.0.38" ,
2121 "@clerk/themes" : " ^2.1.29" ,
2222 "@netlify/functions" : " ^2.8.1" ,
23+ "@netlify/integrations" : " ^0.5.4" ,
24+ "@netlify/sentry" : " ^0.0.10" ,
2325 "@nuxt/content" : " ^2.13.2" ,
2426 "@radix-icons/vue" : " ^1.0.0" ,
2527 "@sentry/nuxt" : " ^8.30.0" ,
You can’t perform that action at this time.
0 commit comments