fix(시간 표시): 서버 시각 모두 끝 Z · Z 없는 옛 기록 = 한국 시각으로 읽음 (PLAN 593-2 · 요구 456)

- 서버: DB 시각 글(DATE_FORMAT) 끝 Z · B03 올린 때 · D04 확정 시각 · 건강 확인 시각 = UTC Z · 개요 최근 변경 T 치환 뺌
- 서버가 만드는 엑셀(E05 면적 계산 시각) = 한국 시각 글(kst_text · Z 없는 옛 글은 이미 한국 시각)
- 화면: Z 없는 글 = 옛 로컬 기록 → +09:00 로 읽음(옛 파일은 고쳐 쓰지 않음)
- 시험: test_593_time(UTC · 서울 · 뉴욕 시간대 · Z 없는 길 0 정적 검사 · D04 · kst_text)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-30 10:26:24 +09:00
co-authored by Claude Sonnet 5.5
parent 764f7e6c51
commit bbc61e5040
12 changed files with 103 additions and 36 deletions
+5 -8
View File
@@ -14,7 +14,6 @@ import logging
import os
import time
from contextlib import asynccontextmanager
from datetime import datetime
from pathlib import Path
from typing import Any
@@ -112,7 +111,7 @@ from common_util.common_util_auth import (
# 개발환경 전용 — 「확정 없이 다음으로」. **문은 서버가 정본이다** — `ENVIRONMENT` 가
# 개발이 아니면 세 입구 모두 403 으로 거절한다(화면 단추 숨김은 보조).
from common_util.common_util_dev_unlock_router import router as dev_unlock_router
from common_util.common_util_time import install_json_utc
from common_util.common_util_time import install_json_utc, utc_from_timestamp
from common_util.common_util_help_router import router as help_router
from common_util.common_util_map_router import router as map_router
from common_util.common_util_resource_monitor import sample_resources_loop
@@ -232,7 +231,7 @@ async def lifespan(app: FastAPI):
logger.info(
"[reload] 감시 폴더 %d개, 소스 최신 수정 %s",
len(reload_dirs()),
datetime.fromtimestamp(_CODE_MTIME_AT_START).isoformat(timespec="seconds"),
utc_from_timestamp(_CODE_MTIME_AT_START),
)
# ⚠⚠ **리로드마다 프론트를 다시 빌드하지 않는다** (2026-09-12 실측으로 드러난 자리).
@@ -447,11 +446,9 @@ async def health():
body: dict[str, Any] = {"status": "ok", "environment": ENVIRONMENT}
if DEBUG:
newest = _newest_source_mtime()
body["started_at"] = datetime.fromtimestamp(_STARTED_AT).isoformat(timespec="seconds")
body["code_mtime"] = datetime.fromtimestamp(_CODE_MTIME_AT_START).isoformat(
timespec="seconds"
)
body["source_mtime"] = datetime.fromtimestamp(newest).isoformat(timespec="seconds")
body["started_at"] = utc_from_timestamp(_STARTED_AT)
body["code_mtime"] = utc_from_timestamp(_CODE_MTIME_AT_START)
body["source_mtime"] = utc_from_timestamp(newest)
# 1초 여유 — 저장 직후의 미세한 시각차로 헛경고가 뜨지 않게.
body["stale"] = newest > _CODE_MTIME_AT_START + 1.0
return body