让免费层限流的报告跟真实限流一致,并给少一块结果的静默失败留下函数名和错误类型。
Co-Authored-By: Grok (agent loop)
This commit is contained in:
co-authored by
Grok (agent loop)
parent
e4ff62c738
commit
a7162db271
@@ -14,6 +14,9 @@ from typing import Dict, Optional, List
|
||||
from datetime import datetime, timedelta
|
||||
import sys
|
||||
import os
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
@@ -40,8 +43,9 @@ def _get_sun_moon_lons(year: int, month: int, day: int,
|
||||
sun_res = swe.calc_ut(jd_ut, swe.SUN, flags)
|
||||
moon_res = swe.calc_ut(jd_ut, swe.MOON, flags)
|
||||
return _primary_longitude(sun_res[0]), _primary_longitude(moon_res[0]), True
|
||||
except Exception:
|
||||
pass
|
||||
except Exception as exc:
|
||||
logger.warning("cmd_muhurta._get_sun_moon_lons degraded: %s", type(exc).__name__)
|
||||
logger.debug("cmd_muhurta._get_sun_moon_lons degraded", exc_info=True)
|
||||
# 近似算法
|
||||
from muhurta import _approx_sun_moon_lon
|
||||
sun_lon, moon_lon = _approx_sun_moon_lon(year, month, day)
|
||||
|
||||
Reference in New Issue
Block a user