Openstatus www.openstatus.dev
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bug cron (#128)

* 🚑 fix

* 🚑 fix

authored by

Thibault Le Ouay and committed by
GitHub
c516b32e 49106c9a

+7 -3
+2 -2
apps/web/src/app/api/checker/cron/_cron.ts
··· 52 52 .where(eq(monitorsToPages.monitorId, row.id)) 53 53 .all(); 54 54 55 - const allMonitorsRegions = currentRegions.parse(row.regions); 56 - if (allMonitorsRegions.length === 0) { 55 + if (row.regions.length === 0) { 57 56 const payload: z.infer<typeof payloadSchema> = { 58 57 workspaceId: String(row.workspaceId), 59 58 monitorId: String(row.id), ··· 70 69 }); 71 70 allResult.push(result); 72 71 } else { 72 + const allMonitorsRegions = currentRegions.parse(row.regions); 73 73 for (const region of allMonitorsRegions) { 74 74 const payload: z.infer<typeof payloadSchema> = { 75 75 workspaceId: String(row.workspaceId),
+5 -1
packages/db/src/schema/monitor.ts
··· 123 123 jobType: z.enum(["website", "cron", "other"]).default("other"), 124 124 active: z.boolean().default(false), 125 125 regions: z 126 - .preprocess((val) => String(val).split(","), z.array(RegionEnum)) 126 + .preprocess((val) => { 127 + if (String(val).length > 0) { 128 + return String(val).split(","); 129 + } 130 + }, z.array(RegionEnum)) 127 131 .default([]), 128 132 }); 129 133