@@ -28,7 +28,6 @@ import {
2828import { regionDict } from "@openstatus/regions" ;
2929import { db } from "../lib/db" ;
3030
31- import { getSentry } from "@hono/sentry" ;
3231import { getLogger } from "@logtape/logtape" ;
3332import type { monitorPeriodicitySchema } from "@openstatus/db/src/schema/constants" ;
3433import {
@@ -37,7 +36,6 @@ import {
3736 type tpcPayloadSchema ,
3837 transformHeaders ,
3938} from "@openstatus/utils" ;
40- import type { Context } from "hono" ;
4139import { env } from "../env" ;
4240
4341type TaskInput = {
@@ -64,8 +62,7 @@ const client = new CloudTasksClient({
6462
6563export async function sendCheckerTasks (
6664 periodicity : z . infer < typeof monitorPeriodicitySchema > ,
67- c : Context ,
68- ) {
65+ ) : Promise < { success : number ; failed : number } > {
6966 const parent = client . queuePath (
7067 env ( ) . GCP_PROJECT_ID ,
7168 env ( ) . GCP_LOCATION ,
@@ -121,7 +118,7 @@ export async function sendCheckerTasks(
121118
122119 if ( monitors . data . length === 0 ) {
123120 logger . info ( "No monitors to check" , { periodicity } ) ;
124- return ;
121+ return { success : 0 , failed : 0 } ;
125122 }
126123
127124 // Batch fetch all monitor statuses in a single query (N+1 fix)
@@ -235,11 +232,9 @@ export async function sendCheckerTasks(
235232 failed_count : failed ,
236233 success_count : success ,
237234 } ) ;
238- getSentry ( c ) . captureMessage (
239- `sendCheckerTasks for ${ periodicity } ended with ${ failed } failed tasks` ,
240- "error" ,
241- ) ;
242235 }
236+
237+ return { success, failed } ;
243238}
244239// timestamp needs to be in ms
245240const createCronTask = async (
0 commit comments