Quiet the logs and capture the errors that were missing
- Activity page: "Delete all" empties the open tab (api/admin/logs/clear-logs, super admin only, logged under system) - Stop logging every WebSocket connect - Log unexpected API errors (safeErrorMessage -> logUnexpectedError), every failed bot job attempt and every job the queue lost - Drop the cron jobs' console output; a failed model sync goes to the logs Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
import bunext from "@moduletrace/bunext";
|
||||
import syncAllHarnessModels from "@/src/functions/backend/db/harness/sync-all-harness-models";
|
||||
import { logError } from "@/src/functions/backend/logger";
|
||||
|
||||
/**
|
||||
* Refreshes every enabled provider's model list. Free models on OpenRouter
|
||||
* come and go, and automatic picks follow them from this list.
|
||||
* come and go, and automatic picks follow them from this list. A provider
|
||||
* that fails doesn't fail the run, so its error goes to the logs here.
|
||||
*/
|
||||
export default async function cronSyncHarnessModels() {
|
||||
const results = await syncAllHarnessModels();
|
||||
|
||||
for (const result of results) {
|
||||
if (result.error) {
|
||||
bunext.bunextLog.error(
|
||||
`Cron: model sync for provider #${result.provider_id} failed: ${result.error}`,
|
||||
);
|
||||
} else {
|
||||
bunext.bunextLog.info(
|
||||
`Cron: provider #${result.provider_id} lists ${result.count} model(s)`,
|
||||
);
|
||||
}
|
||||
if (!result.error) continue;
|
||||
|
||||
await logError({
|
||||
title: `Cron: model sync for provider #${result.provider_id} failed`,
|
||||
category: "cron",
|
||||
error: result.error,
|
||||
metadata: { provider_id: result.provider_id },
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
return results;
|
||||
|
||||
Reference in New Issue
Block a user