diff options
| author | Agando <roduccomm@gmail.com> | 2026-11-09 15:36:23 +0100 |
|---|---|---|
| committer | Agando <roduccomm@gmail.com> | 2026-11-09 15:36:23 +0100 |
| commit | a065a4c30be748b0c8fc6dd0b5ee1dc4d3de4b1c (patch) | |
| tree | 8a84adabfccee9994937cd71888170ab205b9361 /.bkp-fix-20261023_143429/health.php | |
| parent | a46ebee30cfbbac86abb45068411bc28e1c65503 (diff) | |
The daily collector and the feedback pipeline had left 57 modified files uncommitted (skills,
modules-index, CHANGELOG, feedback decisions, debug counters). The public mirror publishes git
HEAD, so without this the published repo stayed behind the tree - and it blocked the publisher
outright once uncommitted subtrees started failing loudly.
Diffstat (limited to '.bkp-fix-20261023_143429/health.php')
| -rw-r--r-- | .bkp-fix-20261023_143429/health.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/.bkp-fix-20261023_143429/health.php b/.bkp-fix-20261023_143429/health.php new file mode 100644 index 0000000..5a0048f --- /dev/null +++ b/.bkp-fix-20261023_143429/health.php @@ -0,0 +1,20 @@ +<?php +require_once __DIR__ . '/config.php'; + +$errors = load_json(ERRORS_FILE); +$sessions = load_json(SESSIONS_FILE); + +$lastError = !empty($errors) ? end($errors) : null; + +json_response([ + 'success' => true, + 'status' => 'ok', + 'uptime' => filemtime(__FILE__) ? (time() - filemtime(__FILE__)) : 0, + 'total_errors' => count($errors), + 'total_sessions' => count($sessions), + 'errors_file_size_kb' => file_exists(ERRORS_FILE) ? round(filesize(ERRORS_FILE) / 1024, 1) : 0, + 'sessions_file_size_kb' => file_exists(SESSIONS_FILE) ? round(filesize(SESSIONS_FILE) / 1024, 1) : 0, + 'last_ingest' => $lastError ? ($lastError['ingested_at'] ?? null) : null, + 'last_ingest_message' => $lastError ? substr($lastError['message'] ?? '', 0, 100) : null, + 'generated_at' => date('c'), +]); |