移除源码中硬编码的 API token:NOAA MesoWest 密钥和 CWA 占位符
This commit is contained in:
@@ -611,7 +611,7 @@ def _reconcile_recent_noaa_actual_highs(city_name: str, lookback_days: int = 14)
|
|||||||
"showemptystations": 1,
|
"showemptystations": 1,
|
||||||
"recent": recent_minutes,
|
"recent": recent_minutes,
|
||||||
"complete": 1,
|
"complete": 1,
|
||||||
"token": "7c76618b66c74aee913bdbae4b448bdd",
|
"token": os.environ.get("NOAA_WRH_MESO_TOKEN", ""),
|
||||||
"obtimezone": "local",
|
"obtimezone": "local",
|
||||||
},
|
},
|
||||||
headers={
|
headers={
|
||||||
|
|||||||
@@ -251,7 +251,8 @@ class WeatherDataCollector(OpenMeteoCacheMixin, SettlementSourceMixin, MetarSour
|
|||||||
self.cwa_open_data_auth = (
|
self.cwa_open_data_auth = (
|
||||||
os.getenv("CWA_OPEN_DATA_AUTH")
|
os.getenv("CWA_OPEN_DATA_AUTH")
|
||||||
or os.getenv("CWA_OPEN_DATA_API_KEY")
|
or os.getenv("CWA_OPEN_DATA_API_KEY")
|
||||||
or "rdec-key-123-45678-011121314"
|
or ""
|
||||||
|
)
|
||||||
).strip()
|
).strip()
|
||||||
|
|
||||||
# 磁盘持久化缓存:重启后即可加载上次的预报数据,避免冷启动请求爆发
|
# 磁盘持久化缓存:重启后即可加载上次的预报数据,避免冷启动请求爆发
|
||||||
|
|||||||
Reference in New Issue
Block a user