Error log, retry notice, a waiting counter that keeps counting
- generation_errors: every failed attempt (model, attempt, outcome, duration); admin Hibanapló page and GET /v1/admin/errors; kept 90 days - The waiting page counts from when the text was asked for (requested_at), not from the page load, so a reload no longer restarts it - It says when an attempt failed and is retried, and when a failed text's unit was given back; admins see the error Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -49,11 +49,16 @@ pub struct AnalysisRow {
|
||||
pub credits_charged: i32,
|
||||
pub created_at: OffsetDateTime,
|
||||
pub completed_at: Option<OffsetDateTime>,
|
||||
/// Attempts so far; above 1 the page says it is being tried again.
|
||||
pub attempts: i32,
|
||||
pub next_attempt_at: OffsetDateTime,
|
||||
/// When the current text was asked for (set again by a regeneration).
|
||||
pub requested_at: OffsetDateTime,
|
||||
}
|
||||
|
||||
const ANALYSIS_COLUMNS: &str = "id, kind, chart_id, synastry_id, forecast_id, language, prompt_version, status, \
|
||||
content, error, \
|
||||
credits_charged, created_at, completed_at";
|
||||
credits_charged, created_at, completed_at, attempts, next_attempt_at, requested_at";
|
||||
|
||||
impl AnalysisRow {
|
||||
pub fn view(&self) -> Value {
|
||||
@@ -71,6 +76,9 @@ impl AnalysisRow {
|
||||
"credits_charged": self.credits_charged,
|
||||
"created_at": rfc3339(self.created_at),
|
||||
"completed_at": rfc3339_opt(self.completed_at),
|
||||
"attempts": self.attempts,
|
||||
"next_attempt_at": rfc3339(self.next_attempt_at),
|
||||
"requested_at": rfc3339(self.requested_at),
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -391,7 +399,7 @@ pub async fn regenerate(
|
||||
"UPDATE analyses SET status = 'pending', content = NULL, error = NULL, model_used = NULL, \
|
||||
input_tokens = NULL, output_tokens = NULL, cost_usd = NULL, attempts = 0, next_attempt_at = now(), \
|
||||
started_at = NULL, completed_at = NULL, model = $2, prompt_version = $3, cache_key = $4, \
|
||||
fallback_model = $5, on_fallback = false \
|
||||
fallback_model = $5, on_fallback = false, requested_at = now() \
|
||||
WHERE id = $1 AND status IN ('done', 'failed') RETURNING {ANALYSIS_COLUMNS}"
|
||||
))
|
||||
.bind(id)
|
||||
|
||||
Reference in New Issue
Block a user