fix: vessel_store 타임존 수정 + 모선 추론 이식 + 검토 목록 동기화 #221
6
prediction/cache/vessel_store.py
vendored
6
prediction/cache/vessel_store.py
vendored
@ -1,8 +1,11 @@
|
||||
import logging
|
||||
from datetime import datetime, timezone
|
||||
from typing import Optional
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
import numpy as np
|
||||
|
||||
_KST = ZoneInfo('Asia/Seoul')
|
||||
import pandas as pd
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -126,8 +129,9 @@ class VesselStore:
|
||||
max_ts = pd.to_datetime(df_all['timestamp'].dropna()).max()
|
||||
if hasattr(max_ts, 'to_pydatetime'):
|
||||
max_ts = max_ts.to_pydatetime()
|
||||
# timestamp는 UTC aware → KST wall-clock naive로 변환
|
||||
if isinstance(max_ts, datetime) and max_ts.tzinfo is not None:
|
||||
max_ts = max_ts.replace(tzinfo=None)
|
||||
max_ts = max_ts.astimezone(_KST).replace(tzinfo=None)
|
||||
self._last_bucket = max_ts
|
||||
|
||||
vessel_count = len(self._tracks)
|
||||
|
||||
불러오는 중...
Reference in New Issue
Block a user