File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import log from "../components/utils/log" ;
22import client from "../components/client" ;
33import { CronJobInfo } from "../cron" ;
4+ import * as Sentry from "@sentry/node" ;
45
56export const info : CronJobInfo = {
67 name : "Ping" ,
78 description : "Ping WhatsApp Client" ,
8- schedule : "*/5 * * * *" , // every 5 minutes
9+ schedule : "0 * * * *" , // every hour
910 runOnStartup : false ,
1011} ;
1112
@@ -17,6 +18,7 @@ export default async function () {
1718 `Successfully fetched ${ chats . length } chats to keep session alive.` ,
1819 ) ;
1920 } catch ( err ) {
21+ Sentry . captureException ( err ) ;
2022 log . error ( "Ping" , err ) ;
2123 }
2224}
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import speedTest from "speedtest-net";
22import log from "../components/utils/log" ;
33import redis from "../components/redis" ;
44import { CronJobInfo } from "../cron" ;
5+ import * as Sentry from "@sentry/node" ;
56
67export const CACHE_KEY = "speedtest:result" ;
78const CACHE_TTL = 60 * 60 ; // 1 hour
@@ -33,6 +34,7 @@ export default async function () {
3334 } ,
3435 } ) ;
3536 } catch ( err ) {
37+ Sentry . captureException ( err ) ;
3638 log . error ( "SpeedTestJob" , err ) ;
3739 }
3840}
You can’t perform that action at this time.
0 commit comments