(checkIn: CheckIn, upsertMonitorConfig?: MonitorConfig)
| 190 | * to create a monitor automatically when sending a check in. |
| 191 | */ |
| 192 | export function captureCheckIn(checkIn: CheckIn, upsertMonitorConfig?: MonitorConfig): string { |
| 193 | const scope = getCurrentScope(); |
| 194 | const client = getClient(); |
| 195 | if (!client) { |
| 196 | DEBUG_BUILD && debug.warn('Cannot capture check-in. No client defined.'); |
| 197 | } else if (!client.captureCheckIn) { |
| 198 | DEBUG_BUILD && debug.warn('Cannot capture check-in. Client does not support sending check-ins.'); |
| 199 | } else { |
| 200 | return client.captureCheckIn(checkIn, upsertMonitorConfig, scope); |
| 201 | } |
| 202 | |
| 203 | return uuid4(); |
| 204 | } |
| 205 | |
| 206 | /** |
| 207 | * Wraps a callback with a cron monitor check in. The check in will be sent to Sentry when the callback finishes. |
no test coverage detected