mirror of
https://github.com/dcarrillo/atalaya.git
synced 2026-04-18 02:24:05 +00:00
refactor: use console.info for log consistency and clean up deprecated code
This commit is contained in:
@@ -32,7 +32,7 @@ export async function handleAggregation(env: Env): Promise<void> {
|
||||
await deleteOldRawData(env.DB, now);
|
||||
await deleteOldHourlyData(env.DB, now);
|
||||
|
||||
console.warn(
|
||||
console.info(
|
||||
JSON.stringify({
|
||||
event: 'aggregation_complete',
|
||||
hour: new Date(hourStart * 1000).toISOString(),
|
||||
|
||||
@@ -131,7 +131,7 @@ const worker = {
|
||||
})
|
||||
);
|
||||
|
||||
console.warn(
|
||||
console.info(
|
||||
JSON.stringify({
|
||||
event: 'scheduled_complete',
|
||||
checks: checks.length,
|
||||
@@ -161,7 +161,7 @@ async function executeCheck(check: CheckRequest, env: Env): Promise<CheckResult>
|
||||
// If region is specified and we have Durable Object binding, run check from that region
|
||||
if (check.region && env.REGIONAL_CHECKER_DO) {
|
||||
try {
|
||||
console.warn(
|
||||
console.info(
|
||||
JSON.stringify({ event: 'regional_check_start', monitor: check.name, region: check.region })
|
||||
);
|
||||
|
||||
@@ -186,7 +186,7 @@ async function executeCheck(check: CheckRequest, env: Env): Promise<CheckResult>
|
||||
// Ignore kill errors - Durable Object will be garbage collected
|
||||
}
|
||||
|
||||
console.warn(
|
||||
console.info(
|
||||
JSON.stringify({
|
||||
event: 'regional_check_complete',
|
||||
monitor: check.name,
|
||||
@@ -216,7 +216,7 @@ async function executeCheck(check: CheckRequest, env: Env): Promise<CheckResult>
|
||||
}
|
||||
|
||||
async function executeLocalCheck(check: CheckRequest): Promise<CheckResult> {
|
||||
console.warn(JSON.stringify({ event: 'local_check_start', monitor: check.name }));
|
||||
console.info(JSON.stringify({ event: 'local_check_start', monitor: check.name }));
|
||||
switch (check.type) {
|
||||
case 'http': {
|
||||
return executeHttpCheck(check);
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
// Temporary import for next edit
|
||||
import { isInMaintenance } from '../utils/maintenance.js';
|
||||
@@ -6,7 +6,7 @@ import type { CheckRequest, CheckResult } from '../types.js';
|
||||
|
||||
export class RegionalChecker extends DurableObject {
|
||||
async runCheck(check: CheckRequest): Promise<CheckResult> {
|
||||
console.warn(JSON.stringify({ event: 'regional_check_run', monitor: check.name }));
|
||||
console.info(JSON.stringify({ event: 'regional_check_run', monitor: check.name }));
|
||||
|
||||
try {
|
||||
// Execute the check locally in this Durable Object's region
|
||||
|
||||
Reference in New Issue
Block a user